class

PlaceOS::Model::OAuthToken

Inherits PlaceOS::Model::Timestamps < PlaceOS::Model::Scope < PlaceOS::Model::Associations < PlaceOS::Model::ModelWithAutoKey < Neuroplastic < PgORM::Base < PgORM::Validators < PgORM::Table < PgORM::Persistence < PgORM::Associations < ActiveModel::Callbacks < ActiveModel::Validation < ActiveModel::Model < DB::Mappable < DB::Serializable < YAML::Serializable < JSON::Serializable < Reference < Object

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

Constants

CALLBACKS = { before_save: [] of Nil, after_save: [] of Nil, before_create: [do self.created_at = self.updated_at = Time.utc end] of Nil, after_create: [] of Nil, before_update: [do self.updated_at = Time.utc end] of Nil, after_update: [] of Nil, before_destroy: [] of Nil, after_destroy: [] of Nil, }

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

Log = ::Log.for(self)

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

PRIMARY_KEY_TYPES = {:id => (Int64 | Nil)} of Nil => Nil

macro level key => type

PRIMARY_KEYS = [{:id}]

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

Constructors

from_json(string_or_io : String | IO, trusted : Bool = false) : self

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

from_json(string_or_io : String | IO, root : String, trusted : Bool = false) : self

Deserializes the given JSON in string_or_io into an instance of self, assuming the JSON consists of an JSON object with key root, and whose value is the value to deserialize. Will not deserialise from fields with mass_assign: false

class User < ActiveModel::Model
  attribute name : String
  attribute google_id : UUID, mass_assign: false
end

User.from_json(%({"main": {"name": "Jason", "google_id": "f6f70bfb-c882-446d-8758-7ce47db39620"}}), root: "main") # => #<User:0x103131b20 @name="Jason">
from_trusted_json(string_or_io : String | IO, root : String) : self

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

from_trusted_json(string_or_io : String | IO) : self

Serialize from a trusted JSON source

from_trusted_yaml(string_or_io : String | IO) : self

Serialize from a trusted YAML source

from_yaml(string_or_io : String | IO, trusted : Bool = false) : self

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

Source
new(pull : JSON::PullParser)

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

Source
new(rs : DB::ResultSet)

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

new(jti : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, token_type : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, client_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, sub : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, scope : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, issued_at : Int64 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, expires_at : Int64 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, cert_thumbprint : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, revoked_at : Int64 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, id : Int64 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, created_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, updated_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new)

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

Initialize PlaceOS::Model::OAuthToken from HTTP::Params.

Class methods

attributes

Returns all attribute keys.

changes(id : Int64 | Nil | Nil = nil) : ChangeFeed

Changefeed at row (if id passed) or whole table level. Returns a ChangeFeed instance which can be used to invoke async callbacks via on or use blocking Iterator via each method.

elastic

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

from_rs(__temp_2471 : DB::ResultSet)

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

on_error(err : Exception | IO::Error)

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

primary_key

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

Source
table_name

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

Instance methods

after_create

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

after_destroy

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

after_initialize(trusted : Bool)

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

after_save

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

after_update

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

apply_defaults

Generate code to apply default values

assign_attributes(jti : String | Missing = Missing, token_type : String | Nil | Missing = Missing, client_id : String | Nil | Missing = Missing, sub : String | Nil | Missing = Missing, scope : String | Nil | Missing = Missing, issued_at : Int64 | Nil | Missing = Missing, expires_at : Int64 | Nil | Missing = Missing, cert_thumbprint : String | Nil | Missing = Missing, revoked_at : Int64 | Nil | Missing = Missing, id : Int64 | Nil | Missing = Missing, created_at : Time | Missing = Missing, updated_at : Time | Missing = Missing)

Assign to multiple attributes.

assign_attributes(params : HTTP::Params | Hash(String, String) | Tuple(String, String))

Assign to multiple attributes via HTTP::Params.

assign_attributes(model : PlaceOS::Model::OAuthToken)

Assign to multiple attributes from a model object

assign_attributes_from_json(json, root : String)

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

assign_attributes_from_json(json)

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

assign_attributes_from_trusted_json(json, root : String)

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

assign_attributes_from_trusted_json(json)

Assign each field from JSON if field exists in JSON and has changed in model

assign_attributes_from_trusted_yaml(yaml)

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

assign_attributes_from_yaml(yaml)

Uses the YAML parser as JSON is valid YAML

attributes

Returns a Hash of all attribute values

attributes_tuple

Returns a NamedTuple of all attribute values.

before_create

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

before_destroy

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

before_save

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

before_update

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

cert_thumbprint

cert_thumbprint getter

cert_thumbprint=(value : String | Nil)

cert_thumbprint setter

cert_thumbprint_assigned?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

cert_thumbprint_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

cert_thumbprint_changed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

cert_thumbprint_default

cert_thumbprint's default value

Source
cert_thumbprint_present?
cert_thumbprint_removed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

cert_thumbprint_was

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

cert_thumbprint_will_change!

Include cert_thumbprint in the set of changed attributes, whether it has changed or not.

changed?

Check if any attributes have changed.

changed_attributes

Returns a Hash with all changed attributes.

changed_json(io : IO) : Nil

Serialize the set of changed attributes to JSON.

changed_json

Serialize the set of changed attributes to JSON.

changed_persist_attributes

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

changed_yaml(io : IO) : Nil

Serialize the set of changed attributes to YAML.

changed_yaml

Serialize the set of changed attributes to YAML.

clear_changes_information

Reset changes for all attributes.

client_id

client_id getter

client_id=(value : String | Nil)

client_id setter

client_id_assigned?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

client_id_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

client_id_changed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

client_id_default

client_id's default value

Source
client_id_present?
client_id_removed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

client_id_was

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

client_id_will_change!

Include client_id in the set of changed attributes, whether it has changed or not.

created_at

created_at getter

created_at=(value : Time)

created_at setter

created_at?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

created_at_assigned?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

created_at_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

created_at_changed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

created_at_default

created_at's default value

created_at_present?
created_at_removed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

created_at_was

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

created_at_will_change!

Include created_at in the set of changed attributes, whether it has changed or not.

expires_at

expires_at getter

expires_at=(value : Int64 | Nil)

expires_at setter

expires_at_assigned?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

expires_at_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

expires_at_changed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

expires_at_default

expires_at's default value

Source
expires_at_present?
expires_at_removed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

expires_at_was

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

expires_at_will_change!

Include expires_at in the set of changed attributes, whether it has changed or not.

id

id getter

id=(value : Int64 | Nil)

id setter

id?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

id_assigned?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

id_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

id_changed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

id_default

id's default value

id_present?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

id_removed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

id_was

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

id_will_change!

Include id in the set of changed attributes, whether it has changed or not.

invoke_props

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

issued_at

issued_at getter

issued_at=(value : Int64 | Nil)

issued_at setter

issued_at_assigned?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

issued_at_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

issued_at_changed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

issued_at_default

issued_at's default value

Source
issued_at_present?
issued_at_removed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

issued_at_was

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

issued_at_will_change!

Include issued_at in the set of changed attributes, whether it has changed or not.

jti

jti getter

jti=(value : String)

Setters jti setter

jti?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

jti_assigned?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

jti_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

jti_changed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

jti_default

jti's default value

Source
jti_present?
jti_removed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

jti_was

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

jti_will_change!

Include jti in the set of changed attributes, whether it has changed or not.

persistent_attributes

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

primary_key

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

Source
primary_key_hash

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

restore_attributes

Reset each attribute to their previous values and clears all changes.

revoke!

Stamps revoked_at to the current time (epoch seconds) and saves. No-op if already revoked.

Source
revoked?

true if the token has been marked revoked via revoked_at.

Source
revoked_at

revoked_at getter

revoked_at=(value : Int64 | Nil)

revoked_at setter

revoked_at_assigned?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

revoked_at_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

revoked_at_changed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

revoked_at_default

revoked_at's default value

Source
revoked_at_present?
revoked_at_removed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

revoked_at_was

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

revoked_at_will_change!

Include revoked_at in the set of changed attributes, whether it has changed or not.

scope

scope getter

scope=(value : String | Nil)

scope setter

scope_assigned?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

scope_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

scope_changed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

scope_default

scope's default value

Source
scope_present?
scope_removed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

scope_was

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

scope_will_change!

Include scope in the set of changed attributes, whether it has changed or not.

sub

sub getter

sub=(value : String | Nil)

sub setter

sub_assigned?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

sub_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

sub_changed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

sub_default

sub's default value

Source
sub_present?
sub_removed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

sub_was

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

sub_will_change!

Include sub in the set of changed attributes, whether it has changed or not.

table_name

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

token_type

token_type getter

token_type=(value : String | Nil)

token_type setter

token_type_assigned?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

token_type_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

token_type_changed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

token_type_default

token_type's default value

Source
token_type_present?
token_type_removed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

token_type_was

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

token_type_will_change!

Include token_type in the set of changed attributes, whether it has changed or not.

updated_at

updated_at getter

updated_at=(value : Time)

updated_at setter

updated_at?

NOTE: use getter / getter! (not property / property!) so that the setter defined later in __create_initializer__ is the only setter on the field. Crystal's overload resolution silently fails to replace a property-defined setter with one of identical signature for generic types (e.g. Set(String)?, Array(String)?, String | Array(String)), although it does work for non-generic ones like String?. Defining the setter only once via __create_initializer__ ensures change tracking, sanitization, and custom setter blocks run uniformly across all types.

updated_at_assigned?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

updated_at_change

Returns a Tuple of the previous and the current value of an instance variable if it has changed

updated_at_changed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

updated_at_default

updated_at's default value

updated_at_present?
updated_at_removed?

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

updated_at_was

Persistence backing for the auth.cr AuthlyAdapter::TokenStore. Each row records the metadata of a single OAuth2 access or refresh token; the revoked_at column lets the auth service mark a token invalid without rotating signing keys.

See migration 20260519100000000_add_oauth_tokens.sql for the column rationale (notably: most columns are nullable so a revoke for a never-stored refresh token can still leave a marker).

updated_at_will_change!

Include updated_at in the set of changed attributes, whether it has changed or not.

validate_nilability

Validate that all non-nillable fields have values.

Macros

scope(name, &block)

Nested types