class
Cryap::Database::Models::Session
- Cryap::Database::Models::Session
- Cryap::Database::Model
- Reference
- Object
Defined in:
models/session.crConstructors
- .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
- .new(unpacker : Neo4j::PackStream::Unpacker)
- .new(token : String, id : KSUID = KSUID.new, created_at : Time = Time.utc, scopes : Array(Cryap::API::OAuth2::Scope) = [] of Scope)
Class Method Summary
Instance Method Summary
- #application : Cryap::Database::Models::Application | Nil
- #created_at : Time
- #delete
- #id : KSUID
-
#require_scope!(*required_scopes : Scope)
If at least one of the listed scopes is not available to the token, it raises an error
-
#require_scope?(*required_scopes : Scope) : Bool
If at least one of the listed scopes is not available to the token, it returns false
- #scopes : Array(Scope)
- #token : String
- #user : Cryap::Database::Models::LocalAccount
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(token : String, id : KSUID = KSUID.new, created_at : Time = Time.utc, scopes : Array(Cryap::API::OAuth2::Scope) = [] of Scope)
#
Class Method Detail
Instance Method Detail
If at least one of the listed scopes is not available to the token, it raises an error
If at least one of the listed scopes is not available to the token, it returns false