Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
PlaceOS::Model::GroupInvitation
Inherits PlaceOS::Model::GroupHistory::Mixin < PgORM::Timestamps < 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
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Constants
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
macro level key => type
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Constructors
Build a fresh invitation, generating a cryptographically strong
secret. The returned instance exposes .plaintext_secret only until
the current process ends; it is not reloadable from the database.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
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">
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Class methods
Returns all attribute keys.
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.
Find an invitation by its plaintext secret (constant cost; the
unique index is on secret_digest). Returns nil if no match or the
invitation has expired.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Instance methods
Accept the invitation for the given user. Creates (or updates) a GroupUser row with the invitation's permissions, then destroys the invitation. Raises if the invitation has expired.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Generate code to apply default values
Assign to multiple attributes.
Assign to multiple attributes via HTTP::Params.
Assign to multiple attributes from a model object
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Assign each field from JSON if field exists in JSON and has changed in model
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Uses the YAML parser as JSON is valid YAML
Returns a Hash of all attribute values
Returns a NamedTuple of all attribute values.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Check if any attributes have changed.
Returns a Hash with all changed attributes.
Serialize the set of changed attributes to JSON.
Serialize the set of changed attributes to JSON.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Serialize the set of changed attributes to YAML.
Serialize the set of changed attributes to YAML.
Reset changes for all attributes.
created_at getter
Setters
created_at setter
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.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
created_at's default value
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Include created_at in the set of changed attributes, whether it has changed or not.
email getter
email setter
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.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Include email in the set of changed attributes, whether it has changed or not.
expires_at getter
expires_at setter
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Include expires_at in the set of changed attributes, whether it has changed or not.
group_id getter
group_id setter
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.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Include group_id in the set of changed attributes, whether it has changed or not.
id getter
id setter
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
id's default value
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Include id in the set of changed attributes, whether it has changed or not.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
permissions getter
permissions setter
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.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Include permissions in the set of changed attributes, whether it has changed or not.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Plaintext secret — only set transiently on newly-created invitations
(by the .build_with_secret factory). Never persisted, never
serialised. Callers must capture this before the invitation is
handed off to any other consumer.
Plaintext secret — only set transiently on newly-created invitations
(by the .build_with_secret factory). Never persisted, never
serialised. Callers must capture this before the invitation is
handed off to any other consumer.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Reset each attribute to their previous values and clears all changes.
secret_digest getter
secret_digest setter
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.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Include secret_digest in the set of changed attributes, whether it has changed or not.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
updated_at getter
updated_at setter
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.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
updated_at's default value
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Grants a user who is not yet in the system (or external) access to a group via a shared secret. The plaintext secret is generated at creation time and returned to the caller once; only its SHA256 digest is persisted. Accepting an invitation materialises it into a GroupUser and then destroys the invitation.
Include updated_at in the set of changed attributes, whether it has changed or not.
Validate that all non-nillable fields have values.