class Cryap::Database::Models::Session

Defined in:

models/session.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Cryap::Database::Model

node_id : Int64 node_id, node_labels : Array(String) node_labels, paginate!(pagination : Cryap::API::Paginator, result : Array(String | Symbol), forward : Array(String | Symbol), column : Symbol, property : Symbol | Nil = nil, &) : Tuple(String, String | Nil) paginate!

Constructor methods inherited from class Cryap::Database::Model

new(unpacker : Neo4j::PackStream::Unpacker)
new(node : Neo4j::Node)
new

Class methods inherited from class Cryap::Database::Model

from_bolt(unpacker : Neo4j::PackStream::Unpacker)
from_bolt(io : IO)
from_bolt
, model_name model_name, paginate!(pagination : Cryap::API::Paginator, result : Array(String | Symbol), forward : Array(String | Symbol), column : Symbol, property : Symbol | Nil = nil, &) : Tuple(String, String | Nil) paginate!

Macros inherited from class Cryap::Database::Model

model(name) model, query!(&block) query!

Constructor Detail

def self.create(user : KSUID | Cryap::Database::Models::LocalAccount, application : KSUID | Cryap::Database::Models::Application | Nil = nil, scopes : Array(Scope) = [Scope::Read, Scope::Write, Scope::Push]) : Session #

def self.new(unpacker : Neo4j::PackStream::Unpacker) #

def self.new(token : String, id : KSUID = KSUID.new, created_at : Time = Time.utc, scopes : Array(Cryap::API::OAuth2::Scope) = [] of Scope) #

Class Method Detail

def self.by_token(token : String) #

def self.from_bolt(unpacker : Neo4j::PackStream::Unpacker) #

Instance Method Detail

def application : Cryap::Database::Models::Application | Nil #

def created_at : Time #

def delete #

def id : KSUID #

def require_scope!(*required_scopes : Scope) #

If at least one of the listed scopes is not available to the token, it raises an error


def require_scope?(*required_scopes : Scope) : Bool #

If at least one of the listed scopes is not available to the token, it returns false


def scopes : Array(Scope) #

def token : String #