PACKAGE
lib.ft4.core.auth
On this page
Types
- _auth_handler
- An auth handler defines who can and should call a specific operation. A new auth handler
- _login_config
- This struct represents default auth descriptor configurations that can be used by the client
- auth_data
- evm_auth_args
- The arguments of the evmauth operation
- module_args
- configuration used by the auth module, as defined in the chromia.yml file
- rule_expression
- rule_operator
- rule_parameters
- rule_variable
- Similar to accounts.rulevariable, but it adds two more variables that only make sense
- signature
- An EVM signature
Functions
- _evm_message_hash
- Given a message, a valid EVM signature will add some information to it prior to hashing it
- _get_evm_signatures
- Retrieves the signers and signatures from the evmsignatures operation.
- _recover_evm_address
- Given the message and signature, extracts the evm address that signed it.
- _validate_evm_address
- Verifies that the signer of a certain message is the signer of the single-sig auth
- _validate_evm_arguments
- Verifies that the arguments passed to the evmauth operation are valid.
- _validate_evm_signature
- Verifies that the signature found in the evmauth operation is valid to authorize the
- _validate_ft4_signature
- Verifies that the signature found in the ftauth operation is valid to authorize the
- _validate_multiple_evm_addresses
- Verifies that the message has been authorized by the multi-sig auth descriptor.
- add_auth_handler
- Utility function that allows easily adding an auth handler.
- add_login_config
- Utility function to help extend the loginconfig function.
- add_overridable_auth_handler
- Like addauthhandler, but the auth handler here defined will not be used if a different
- after_authenticate
- This function can be extended by users to add custom logic after the authentication of
- args
- Retrieves the arguments of the operation that led to this function call
- auth_handler
- Extendable function used to define auth handlers. When called it returns a map of all auth
- authenticate
- calls authenticateandreturncontext and returns just the account
- authenticate_and_return_context
- Verifies that:
- before_authenticate
- This function can be extended by users to add custom logic before the authentication of
- block_height
- block_time
- create_message_from_template
- Creates the message that should be signed on an EVM wallet to approve the given operation.
- equals
- extract_account_and_auth_descriptor
- Extracts the account ID and auth descriptor ID from the args of the auth operation,
- extract_account_id
- Extracts the account ID passed to the auth operation, which is any operation supported by
- fetch_account_and_auth_descriptor
- Extracts the account and accountauthdescriptor from the args of the auth operation,
- generate_operation_auth_message
- Creates message from operation name and arguments. It is used when evmauth is used to
- get_auth_details_from_auth_operation
- Retrieves the account and auth descriptor ID from the auth operation that precedes the
- get_auth_flags
- Returns the flags needed to call a certain operation.
- get_auth_handler
- Finds the auth handler for the provided operation name among all the auth handlers
- get_auth_message_template
- Returns the auth message template that is needed to authorize a certain operation, given its
- get_evm_signatures
- Retrieves the signers and signatures from the evmsignatures operation in the
- get_first_allowed_auth_descriptor
- Calculates the best auth descriptor to use for the given account when calling the given
- get_first_allowed_auth_descriptor_by_signers
- Like getfirstallowedauthdescriptor, but instead of accepting a list of auth descriptors
- get_mount_scope_auth_handler
- Retrieves the auth handler that should be applied to the given operation name, only looking
- greater_or_equal
- greater_than
- is_auth_blacklisted_operation
- Checks whether auth operations cannot be used with provided operation.
- is_auth_op
- Verifies whether the operation passed is an auth operation, that is one of:
- is_evm_signatures_authorized_operation
- Checks whether evmsignatures operation can be used with provided operation.
- is_evm_signatures_op
- Verifies whether the operation passed is evmsignatures
- join_text_list
- Utility function that builds a mount scope given all the parts of it and a number indicating
- less_or_equal
- less_than
- login_config
- This function can be extended by users to add custom login configurations.
- login_rules
- Converts a list of ruleexpression to a complex rule that can be used inside an auth
- login_simple_rule
- Alias for maprule
- map_rule
- Converts a ruleexpression to a gtv config that can be used inside an auth descriptor's
- op_count
- relative_block_height
- Same as accounts.blockheight, but using the relative rule variable.
- relative_block_time
- Same as accounts.blocktime, but using the relative rule variable.
- require_evm_signatures_can_be_used
- Ensures that this operation is authorizing an operation which is whitelisted for usage with
- require_regular_next_operation
- Verifies that the next operation is one that will make use of the auth operation that is
- require_valid_scope_name
- Verifies that the scope name is valid, i.e. that it matches this regex:
- try_fetch_auth_descriptor
- Retrieves an accountauthdescriptor given the account it's associated with and the
- ttl
- Creates a time-to-live rule, which makes the auth descriptor expire after a certain
- valid_scope_name
- Ensures that the scope is valid, also trimming leading and trailing whitespace.
- validate_signer
- Checks if the signer has the correct size
- verify_signers
- Verifies whether provided list of signers have signed the operation/transaction.
- verify_signers_with_message
- Does what verifysigners does, but receives the message as a parameter instead of using
Properties
- EVM_AUTH_OP
- name of the operation used to authorize through EVM signatures
- FT_AUTH_OP
- name of the operation used to authorize through FT signatures
- EVM_ADDRESS_SIZE
- size of a bytearray representing an EVM address, in bytes
- FT_PUBKEY_SIZE
- size of a bytearray representing an FT pubkey, in bytes
- BLOCKCHAIN_RID_PLACEHOLDER
- tag used in auth message construction which will be replaced with blockchain RID
- ACCOUNT_ID_PLACEHOLDER
- tag used in auth message construction which will be replaced with the authorizing account ID
- AUTH_DESCRIPTOR_ID_PLACEHOLDER
- tag used in auth message construction which will be replaced with the authenticating
- NONCE_PLACEHOLDER
- tag used in auth message construction which will be replaced with the unique nonce
- DEFAULT_LOGIN_CONFIG_NAME
- The name of the default login configuration. This will be used when none is specified
- APP_SCOPE
- The constant that defines app level authentication scope.
- OVERRIDE_PREFIX
- This prefix could appear before an auth handler's scope to mark that it can be overridden.