Athena::Security::Bundle::Schema#
Represents the possible properties used to configure and customize the security integration. See the Getting Started docs for more information on how the bundle system works in Athena.
Configuration Properties
password_hashers#
Hash(K, V)
{__nil: nil}
The password hashers of each type of user, keyed by the type, or by the name an APH::PasswordHasherAwareInterface user returns.
A hasher may also be configured by its algorithm alone, e.g. ASEC::User::InMemory => :auto.
password_hashers: {
User => {algorithm: :auto, cost: 12},
ASEC::User::InMemory => :auto,
"legacy" => {id: "legacy_password_hasher"},
}
This property consists of a map of key/value pairs where each value has the following properties:
algorithm#type:
Symboldefault:
autoThe algorithm hashing the passwords:
:auto,:bcrypt, or:native, which all use bcrypt viaAPH::Native.
cost#type:
Int32 | ::Nildefault:
nilThe cost of the bcrypt algorithm, in the range of
APH::Native::COST_RANGE. Defaults to the default cost ofAPH::Native.
migrate_from#type:
Array(String)default:
[] of StringThe names of other password hashers, or algorithms, whose hashed passwords are still verified, and upgraded once their user logs in, see
APH::Migrating.
id#type:
String | ::Nildefault:
nilThe ID of a service including
APH::Interfaceto use instead.
providers#
Hash(K, V)
{__nil: nil}
The user providers, keyed by their name, each configured via exactly one of id, memory, or chain.
This property consists of a map of key/value pairs where each value has the following properties:
id#type:
String | ::Nildefault:
nilThe ID of a service including
ASEC::User::Provider::Interface.
memory#type:
Memorydefault:
{users: nil}Provides the users kept in memory, see
Memory.This property consists of an object with the following properties:
users#type:
Hash(String, NamedTuple(password: String | ::Nil, roles: Array(String))) | ::Nildefault:
nilThe users, keyed by their identifier, each with its hashed password and its roles.
chain#type:
Chaindefault:
{providers: nil}Provides the users of other providers, see
Chain.This property consists of an object with the following properties:
providers#type:
Array(String) | ::Nildefault:
nilThe names of the providers.
firewalls#
Hash(K, V)
{__nil: nil}
The firewalls, keyed by their name. A request belongs to the first firewall matching it, while a firewall without pattern, host, or request_matcher matches every request.
This property consists of a map of key/value pairs where each value has the following properties:
pattern#type:
Regex | ::Nildefault:
nilMatches the requests whose path matches this regex.
host#type:
Regex | ::Nildefault:
nilMatches the requests whose host matches this regex.
methods#type:
Array(String)default:
[] of StringOnly matches the requests using one of these methods, along with pattern or host.
request_matcher#type:
String | ::Nildefault:
nilThe ID of a service including
AHTTP::RequestMatcher::Interfacematching the requests, instead of pattern, host, and methods.
security#type:
Booldefault:
trueWhether security is enabled on the firewall, otherwise its requests are neither authenticated nor checked by
access_controlrules.
provider#type:
String | ::Nildefault:
nilThe name of the user provider loading the users being authenticated, which defaults to the only configured provider.
user_checker#type:
String | ::Nildefault:
nilThe ID of a service including
ASEC::User::Checker::Interfacechecking the account of the users being authenticated. Defaults to anASEC::User::Checker::InMemory.
entry_point#type:
String | ::Nildefault:
nilThe ID of a service including
ASEC::EntryPoint::Interfacestarting the authentication of users who must authenticate, which defaults to the only custom authenticator that includes it. Without one, these users get a401response.
custom_authenticators#type:
Array(String)default:
[] of StringThe IDs of the services including
ASEC::Authenticator::Interfaceauthenticating the requests.
access_control#
Array(T)
[]
The rules requiring an attribute for the requests of firewalls, e.g. a role. A request requires the attribute of the first rule matching it, while a rule without path, host, methods, or request_matcher matches every request.
access_control: [
{path: /^\/admin\/login/, role: "PUBLIC_ACCESS"},
{path: /^\/admin/, role: "ROLE_ADMIN"},
]
This property consists of an array of objects with the following properties:
path#type:
Regex | ::Nildefault:
nilMatches the requests whose path matches this regex.
host#type:
Regex | ::Nildefault:
nilMatches the requests whose host matches this regex.
methods#type:
Array(String)default:
[] of StringOnly matches the requests using one of these methods.
request_matcher#type:
String | ::Nildefault:
nilThe ID of a service including `AHTTP
role#type:
String | ::Nildefault:
nilThe attribute the requests require, or
nilto require nothing, e.g. to exclude them from a later rule.
role_hierarchy#
Hash(String, Array(String))
{} of String => Array(String)
The roles granted by other roles, see ASEC::Role::Hierarchy.
role_hierarchy: {
"ROLE_ADMIN" => ["ROLE_USER"],
"ROLE_SUPER_ADMIN" => ["ROLE_ADMIN"],
}
expose_security_errors#
none
Determines which authentication errors are shown to users, see ASEC::Authentication::ExposeSecurityLevel.