Aller au contenu

omnibridge/symfony Référence de l’API

Étage
Pont
Version
1.x
Vérifié en réel
Son README ne le dit pas
Licence
MIT
composer require omnibridge/symfony:1.x-dev

Lue dans les fichiers PHP du paquet au commit 2b56a255d77e : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.

Omnibridge\Symfony

  • FileLinks class

    The links of the error pages and the profiler open the file on the developer's machine when the site runs in a container: APP_PATH (the project's path on the host, which a site's Makefile writes in .env.local) against kernel.project_dir (its path in the container).

    3 methods · 1 constant

  • OmnibridgeBundle class

    The host's contracts (omnisense/omnibridge) answered by Symfony, for a Symfony application that runs no omnibase: the adapters of config/services.php bound under each contract's name, the locator of ContractsPass, handed to Omnibridge\Runtime at boot - the counterpart of omnibridge/laravel's OmnibridgeServiceProvider.

    4 methods · 1 constant

  • RouterUrls class

    Omnibridge\Contract\Urls under Symfony: the router (the application's, or one that generates through it - omnibase gives its advanced_router) and the asset packages - what Twig's path(), url() and asset() answer, the same strings.

    5 methods

  • TranslatorTranslations class

    Omnibridge\Contract\Translations under Symfony: the application's `translator` (whatever chain it is - omnibase's rewrites the texts of its back office and reads "@domain.key" references before Symfony's ICU catalogues), what Twig's |trans answers, the same strings; and whether a key is there: the translator's own transExists() when it has one (omnibase's: the catalogue of the locale, its fallbacks), else the catalogue of a TranslatorBagInterface, "@domain.key" read as the key of that domain.

    3 methods

Omnibridge\Symfony\Auth

  • AuthRouteLoader class

    The routes of omniauth's ceremonies, at the addresses and under the names an application configured (omniauth.yaml) - by default those scheb/2fa, hwi/oauth-bundle and web-auth/webauthn-symfony-bundle had, so the pages and scripts that name them do not change: the second factor's page and its check (2fa_login, 2fa_login_check), a passkey's options and its sign-in, each identity provider's trip out and return (oauth_<name>, oauth_<name>_check). An application imports them:

    3 methods · 1 constant

  • CeremonyController class

    The steps of a sign-in that sign nobody in yet (AuthRouteLoader's routes): the second factor's page, a passkey's request options, the trip out to an identity provider. The verifications themselves are OmniauthAuthenticator's.

    5 methods · 1 constant

  • Contexts class

    omniauth's Context of a Symfony request: its origin and host (WebAuthn's), the visitor's address and browser, the trusted_device cookie, and the firewall - the "fwl" claim of the trusted devices' tokens, the firewall of the request unless one is set ($firewall: scheb/2fa's tokens named the firewall that asked the second factor).

    3 methods

  • OAuthProviders class

    omniauth's providers from omniauth.yaml: Providers::configured() through the provider packages' factories (omniauth/google's GoogleFactory; a provider without client id is not served), and a provider given as a service ("service") as it is.

    1 method

  • OmniauthAuthenticator class

    One Symfony authenticator for every way omniauth signs in (plan "omniauth", §3.1): the password form, the sign-in link, a passkey, the second factor's form, the return from an identity provider. It knows the requests by their route (the router has run before the firewall), turns each into omniauth's Proof and Context, checks the forms' CSRF token through omnibridge's Tokens contract, and asks Omniauth::verify(); then it answers as Symfony expects:

    10 methods · 4 constants

  • OmniauthBadge class

    On a passport OmniauthAuthenticator made: omniauth decided this sign-in (Result), and its events have already been heard - an application's listener of Security's own events (CheckPassportEvent, LoginSuccessEvent, LoginFailureEvent) that does what an omniauth listener does skips a passport that carries it.

    2 methods · 1 property

  • PendingToken class

    The visitor between two factors: omniauth found the account by a first factor and asks a second one (omniauth's Status::SecondFactorRequired).

    16 methods

  • PendingTrustResolver class

    Security's trust resolver, for which the visitor between two factors (PendingToken) is never fully signed in: IS_AUTHENTICATED_FULLY is refused to it, as scheb/2fa's resolver refuses it to its TwoFactorToken.

    4 methods

  • PendingVoter class

    IS_AUTHENTICATED_2FA_IN_PROGRESS - scheb/2fa's attribute, under the same name - granted to the visitor between two factors (PendingToken) and to nobody else: neither a visitor signed out nor one signed in opens the second factor's page.

    3 methods · 1 constant

  • SecondFactorGate class

    Between two factors, the second factor's page and nothing else: the visitor holding a PendingToken is sent there from any page, as scheb/2fa's TwoFactorAccessListener and its redirection did - but a page access_control opens to everybody (PUBLIC_ACCESS) or to that token (IS_AUTHENTICATED_2FA_IN_PROGRESS), and the sign-out.

    4 methods

  • SessionState class

    omniauth's State under Symfony: the visitor's session (the request's, through the request stack). Without a session - a command, a request without one - nothing is kept.

    4 methods

Omnibridge\Symfony\Auth\DependencyInjection

  • Configuration class

    omniauth.yaml (plan "omniauth", §4.1): the methods mounted - each present key turns its method on, a method whose package is missing cannot be -, their settings, the stores (service ids, by default each contract's own name), where the forms post and what their fields are called, the routes of the ceremonies, the throttle and the pages' messages.

    1 method

  • OmniauthExtension class

    omniauth wired into a Symfony application (plan "omniauth", §3.1, step AU6), from config/packages/omniauth.yaml: the conductor (Omniauth\Omniauth) with the methods present - each key turns its method on; passkeys and TOTP need their package (omniauth/webauthn, omniauth/otp), an identity provider its own (omniauth/google) -, the TOTP secrets sealed at rest when totp.secret_key is set (omniauth/otp's SodiumSecretBox decorating the TotpSecrets store, so whoever reads the store - the method, an enrolment page - reads through it), the second-factor rule (EnrolledSecondFactors, which an application decorates: Omniauth\Contract\SecondFactorPolicy), the session as its State, a PSR-6 pool as its Throttle, Symfony's dispatcher for its events; and around it, the authenticator a firewall names (custom_authenticator: Omnibridge\Symfony\Auth\OmniauthAuthenticator), the second factor's token, voter, trust resolver and gate, the ceremonies' controller and routes (type "omniauth").

    3 methods · 5 constants

Omnibridge\Symfony\Auth\Exception

  • SignInRefused class

    An attempt omniauth (or the bridge, for a CSRF token) refused: the factor, omniauth's stable failure and reason, and the message the page translates (OmniauthAuthenticator's `messages`). IdentityUnknown is one too: a provider vouched for someone no account is linked to ($identity).

    1 method · 4 properties

Omnibridge\Symfony\Contract

  • CsrfTokens class

    Omnibridge\Contract\Tokens under Symfony: the CSRF token manager's token of an intent - what Twig's `csrf_token()` prints -, and its check, the one AbstractController::isCsrfTokenValid() makes.

    3 methods

  • KernelEnvironment class

    Omnibridge\Contract\Environment under Symfony: the kernel's environment, debug and secret - the container's kernel.environment, kernel.debug and kernel.secret.

    4 methods

  • SecurityAccess class

    Omnibridge\Contract\Access under Symfony: Security's authorization checker (the role hierarchy, the application's voters) and token storage - the answers of Twig's is_granted() and app.user.

    3 methods

  • SecuritySessions class

    Omnibridge\Contract\Sessions under Symfony: Security's token storage - the token forgotten when its user is the one signed out - and the REMEMBERME cookie cleared on the path and, when the application says which, on its domain ($domain, asked at sign-out: omnibase gives its router's domain).

    2 methods

Omnibridge\Symfony\DependencyInjection

  • ContractsPass class

    The locator Omnibridge\Runtime reaches the host's contracts through under Symfony, handed to it at boot (OmnibridgeBundle::boot(), or the bundle of an application that runs this pass with its own list - omnibase's BaseBundle): each contract by its interface's name, the service the container binds to that name - this package's adapters (config/services.php), the framework's clock and event dispatcher, or an application's own binding, which wins as any alias does.

    2 methods · 3 constants

Omnibridge\Symfony\Map

  • MapRouteLoader class

    The map cache's routes, at the paths and under the names omnimap.yaml gives (routes): a tile (GET), a picture's metadata (GET), the export of a captured picture and its deletion (POST). An application imports them:

    3 methods · 1 constant

  • SnapshotController class

    The map cache over HTTP (MapRouteLoader's routes):

    5 methods

Omnibridge\Symfony\Map\DependencyInjection

  • Configuration class

    config/packages/omnimap.yaml:

    1 method

  • OmnimapExtension class

    omnisense/omnimap wired into a Symfony application, from config/packages/omnimap.yaml (Configuration): the providers installed (omnimap/google, omnimap/openstreetmap, omnimap/maplibre; any other by the tag omnimap.provider_factory) over the application's HTTP client, a PSR-16 view of its cache pool and, for geocoder-php, a PSR-18 client; the Registry; the map cache (SnapshotStore on an omnidrive drive - cache.drive, of the application's Omnidrive\Drives - or on a Storage service, Snapshots, the server's own pictures when the provider makes images); MapPrinter and omnibridge/twig's MapExtension (omnimap(), omnimap_export(), omnimap_suppress()); the cache's routes (type "omnimap") and their controller.

    5 methods · 2 constants

Omnibridge\Symfony\Static

  • BuildCommand class

    omnibridge/static's build under Symfony: the same Console\Cli as the plain command line, handed what this host offers the site's file - a renderer through this kernel's own request handling (each page a visitor's GET, at --render-origin, by default the router's default URI), the router's routes, the container, the public folder.

    1 method

Omnibridge\Symfony

final class FileLinks FileLinks.php:37

The links of the error pages and the profiler open the file on the developer's machine when the site runs in a container: APP_PATH (the project's path on the host, which a site's Makefile writes in .env.local) against kernel.project_dir (its path in the container).

Symfony's own means, no patch: FileLinkFormatter reads a mapping after the format, "vscode://file/%f:%l&/srv/app/>/Users/me/site/" (framework.ide, SYMFONY_IDE). Two uses:

  • formatter(), the factory of a decoration of debug.file_link_formatter that an application registers itself (no configuration here or in omnibase does): Symfony's FileLinkFormatter on the mapped format - the error pages (error_handler.error_renderer.html, which receives it) and the profiler read it;
  • export(), called when a bundle is constructed (omnibase's BaseBundle), before the container is built: SYMFONY_IDE for the renderer Symfony's ErrorHandler builds itself, for an error that happens before the kernel handles a request (a container that does not compile).

A format that maps already (it has "&...>") or a site with no APP_PATH is left as it is. With no format at all, VS Code's.

Moved from omnisense/omnibase's Base\Bridge\Symfony\FileLinks (plan "omnibase agnostique", A1), where it replaced omnibase's own formatter and error renderer in 4.0; the former name's alias was removed at omnibase 4's final pass.

public static function format(?string $ide, string $projectDir, ?string $hostDir): ?string

The link format with the container-to-host mapping, or $ide unchanged (null for none) when there is nothing to map - in the Glitchr sites' former syntax too, read as Symfony's.

public static function formatter(?FileLinkFormatter $inner, ?string $ide, string $projectDir, ?string $hostDir, ?RequestStack $requestStack = null): ?FileLinkFormatter

The decoration of debug.file_link_formatter: Symfony's formatter on the mapped format (with the profiler's address for a file without a format of its own), or the decorated one when there is nothing to map.

public static function export(?string $projectDir = null): void

SYMFONY_IDE set to the mapped format when a site has APP_PATH and no SYMFONY_IDE of its own, for the renderers built outside the container.

OmnibridgeBundle class

final class OmnibridgeBundle extends AbstractBundle OmnibridgeBundle.php:24

The host's contracts (omnisense/omnibridge) answered by Symfony, for a Symfony application that runs no omnibase: the adapters of config/services.php bound under each contract's name, the locator of ContractsPass, handed to Omnibridge\Runtime at boot - the counterpart of omnibridge/laravel's OmnibridgeServiceProvider.

An omnibase site does not register it: omnibase's BaseBundle loads the same services (config/services.php, with omnibase's router), runs the same pass with omnibase's own contracts added and seeds the registry itself.

const SERVICES = __DIR__ . '/../config/services.php'

The adapters' definitions, what an application's bundle imports to bind the contracts.

OmnibridgeBundle::loadExtension()

public function loadExtension(array $config, ContainerConfigurator $container, ContainerBuilder $builder): void

OmnibridgeBundle::build()

public function build(ContainerBuilder $container): void

OmnibridgeBundle::boot()

public function boot(): void

OmnibridgeBundle::shutdown()

public function shutdown(): void

RouterUrls class

final class RouterUrls implements Urls RouterUrls.php:18

Omnibridge\Contract\Urls under Symfony: the router (the application's, or one that generates through it - omnibase gives its advanced_router) and the asset packages - what Twig's path(), url() and asset() answer, the same strings.

Moved from omnisense/omnibase's Base\Bridge\Symfony\RouterUrls (plan "omnibase agnostique", A1); the former name is an alias of this class.

RouterUrls::__construct()

public function __construct(readonly UrlGeneratorInterface $router, readonly ?Packages $packages = null)

RouterUrls::path()

public function path(string $name, array $parameters = []): string

RouterUrls::url()

public function url(string $name, array $parameters = []): string

RouterUrls::asset()

public function asset(string $path): string

RouterUrls::generate()

public function generate(string $name, array $parameters = [], int $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH): string

Any of the router's reference types, beyond the contract (which has an absolute path and URL only): omnibase's Base\Contract\Link::to() asks it for a relative or a network path.

TranslatorTranslations class

final class TranslatorTranslations implements Translations TranslatorTranslations.php:21

Omnibridge\Contract\Translations under Symfony: the application's translator (whatever chain it is - omnibase's rewrites the texts of its back office and reads "@domain.key" references before Symfony's ICU catalogues), what Twig's |trans answers, the same strings; and whether a key is there: the translator's own transExists() when it has one (omnibase's: the catalogue of the locale, its fallbacks), else the catalogue of a TranslatorBagInterface, "@domain.key" read as the key of that domain.

Moved from omnisense/omnibase's Base\Bridge\Symfony\TranslatorTranslations (plan "omnibase agnostique", A1); the former name is an alias of this class.

TranslatorTranslations::__construct()

public function __construct(readonly TranslatorInterface $translator)

TranslatorTranslations::trans()

public function trans(string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string

TranslatorTranslations::exists()

public function exists(string $id, ?string $domain = null, ?string $locale = null): bool

Omnibridge\Symfony\Auth

AuthRouteLoader class

final class AuthRouteLoader extends Loader AuthRouteLoader.php:23

The routes of omniauth's ceremonies, at the addresses and under the names an application configured (omniauth.yaml) - by default those scheb/2fa, hwi/oauth-bundle and web-auth/webauthn-symfony-bundle had, so the pages and scripts that name them do not change: the second factor's page and its check (2fa_login, 2fa_login_check), a passkey's options and its sign-in, each identity provider's trip out and return (oauth_<name>, oauth_<name>_check). An application imports them:

omniauth: { resource: ., type: omniauth }

The checks are answered by OmniauthAuthenticator before any controller; theirs only sends a stray GET back to its page.

const TYPE = 'omniauth'

AuthRouteLoader::__construct()

public function __construct(readonly array $config, ?string $env = null)
$config

OmniauthExtension's, resolved

AuthRouteLoader::load()

public function load(mixed $resource, ?string $type = null): RouteCollection

AuthRouteLoader::supports()

public function supports(mixed $resource, ?string $type = null): bool

CeremonyController class

final class CeremonyController CeremonyController.php:31

The steps of a sign-in that sign nobody in yet (AuthRouteLoader's routes): the second factor's page, a passkey's request options, the trip out to an identity provider. The verifications themselves are OmniauthAuthenticator's.

The second factor's page renders the application's template with the very variables scheb/2fa's FormController gave it (twoFactorProvider, availableTwoFactorProviders, checkPathUrl, authCodeParameterName, displayTrustedOption, isCsrfProtectionEnabled, logoutPath...), the factors under scheb's names ("email" for omniauth's "email-code"): a template written for scheb/2fa renders unchanged. The code by e-mail is sent when its page is first shown (as scheb/2fa sent it), and again once it expired.

const PROVIDER_NAMES = ['totp' => 'totp', 'email-code' => 'email', 'backup-code' => 'backup-code']

omniauth's factors under the names scheb/2fa gave its providers.

CeremonyController::__construct()

public function __construct(readonly Omniauth $omniauth, readonly Contexts $contexts, readonly UrlGeneratorInterface $urls, readonly TokenStorageInterface $tokens, readonly array $config, readonly ?Environment $twig = null, readonly ?LogoutUrlGenerator $logout = null)
$config

OmniauthExtension's, resolved

CeremonyController::secondFactor()

public function secondFactor(Request $request): Response

CeremonyController::passkeyOptions()

public function passkeyOptions(Request $request): Response

A passkey's request options, in the JSON web-auth/webauthn-symfony-bundle answered: {"status": "ok", "errorMessage": "", ...the options}.

CeremonyController::oauthStart()

public function oauthStart(Request $request, string $provider): Response

The trip out to an identity provider: its authorization address, the state, PKCE and nonce kept in the attempt.

CeremonyController::check()

public function check(Request $request): Response

A check address asked otherwise than the authenticator answers (a GET of the second factor's check): back to its page.

Contexts class

final class Contexts Contexts.php:17

omniauth's Context of a Symfony request: its origin and host (WebAuthn's), the visitor's address and browser, the trusted_device cookie, and the firewall - the "fwl" claim of the trusted devices' tokens, the firewall of the request unless one is set ($firewall: scheb/2fa's tokens named the firewall that asked the second factor).

Contexts::__construct()

public function __construct(readonly RequestStack $requests, readonly ?FirewallMap $firewalls = null, readonly string $cookie = 'trusted_device', readonly ?string $firewall = null)

Contexts::of()

public function of(?Request $request = null): Context

Contexts::firewallName()

public function firewallName(Request $request): ?string

The name of the firewall the request is in, if any.

OAuthProviders class

final class OAuthProviders OAuthProviders.php:25

omniauth's providers from omniauth.yaml: Providers::configured() through the provider packages' factories (omniauth/google's GoogleFactory; a provider without client id is not served), and a provider given as a service ("service") as it is.

Each one's return address is, unless it sets one, the PATH of its check route - never an absolute address made here: this service is built once per worker (FrankenPHP keeps it between requests), so an absolute address would stay on the host of the first request. omniauth completes the path with the origin of each trip's request (Authorization::returnAddress()), and the exchange repeats that address.

OAuthProviders::create()

public static function create(array $config, UrlGeneratorInterface $urls, ContainerInterface $services, iterable|ContainerInterface $factories = []): Providers
$config

omniauth.yaml's oauth.providers

$factories

the provider packages' (tag omniauth.oauth_provider_factory): a service locator of them (the extension's: a tagged iterator inlined by a compiled container lost its factory and passed the factory's own argument), or the factories themselves

OmniauthAuthenticator class

class OmniauthAuthenticator extends AbstractAuthenticator implements AuthenticationEntryPointInterface OmniauthAuthenticator.php:57

One Symfony authenticator for every way omniauth signs in (plan "omniauth", §3.1): the password form, the sign-in link, a passkey, the second factor's form, the return from an identity provider. It knows the requests by their route (the router has run before the firewall), turns each into omniauth's Proof and Context, checks the forms' CSRF token through omnibridge's Tokens contract, and asks Omniauth::verify(); then it answers as Symfony expects:

  • Authenticated: a self-validating passport for the account (omniauth has already checked everything), Security's own remember-me badge when omniauth says to remember the visitor, the trusted_device cookie when it gave one; a PostAuthenticationToken.
  • SecondFactorRequired: a PendingToken (no role, IS_AUTHENTICATED_2FA_IN_PROGRESS alone) and the second factor's page.
  • Failed, IdentityUnknown: SignInRefused, its message the page's (messages), the page the visitor came from; a passkey's in JSON, as web-auth/webauthn-symfony-bundle answered ({"status": "failed", "errorMessage": ...}).

Every passport it makes carries an OmniauthBadge: omniauth's events have been heard, and a listener of Security's that does what one of omniauth's does skips it. A refused sign-in link is no link for the page behind: the route's token parameter is emptied and the page answers as for none. It is the firewall's entry point too, when the application names it so (the sign-in page).

const CHOSEN = 'omnibridge.auth.factor'

Where the second factor's page keeps the factor the visitor chose (scheb/2fa's "preferProvider").

const SECOND_FACTOR_ERROR = 'omnibridge.auth.second_factor_error'

Where a refused second factor's error waits for its page.

const PENDING_IDENTITY = 'omnibridge.auth.pending_identity'

Where an unknown identity waits for the sign-up (omniauth's PendingIdentity, as an array).

const MESSAGES = ['bad-credentials' => 'Invalid credentials.', 'bad-code' => 'code_invalid', 'invalid-link' => 'Invalid credentials.', 'expired' => 'Authentication request co…

The messages a page translates, by omniauth's failure or "failure:reason" ("%reason%" replaced).

OmniauthAuthenticator::__construct()

public function __construct(readonly Omniauth $omniauth, readonly Contexts $contexts, readonly UrlGeneratorInterface $urls, readonly TokenStorageInterface $tokenStorage, readonly ?Tokens $tokens = null, readonly array $config = [])
$config

OmniauthExtension's, resolved

OmniauthAuthenticator::supports()

public function supports(Request $request): ?bool

OmniauthAuthenticator::authenticate()

public function authenticate(Request $request): Passport

OmniauthAuthenticator::createToken()

public function createToken(Passport $passport, string $firewallName): TokenInterface

OmniauthAuthenticator::onAuthenticationSuccess()

public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response

OmniauthAuthenticator::onAuthenticationFailure()

public function onAuthenticationFailure(Request $request, AuthenticationException $exception): ?Response

OmniauthAuthenticator::start()

public function start(Request $request, ?AuthenticationException $authException = null): Response

OmniauthAuthenticator::factorOf()

public function factorOf(Request $request): ?Factor

The factor a request brings, by its route; null when this is no sign-in.

OmniauthAuthenticator::offered()

public function offered(): array
Returns

what the attempt in progress offers

OmniauthAuthenticator::firstOf()

public static function firstOf(array $offered): ?Factor

The factor the second factor's page shows first: the one chosen, else the first offered that is not a backup code.

OmniauthBadge class

final class OmniauthBadge implements BadgeInterface OmniauthBadge.php:15

On a passport OmniauthAuthenticator made: omniauth decided this sign-in (Result), and its events have already been heard - an application's listener of Security's own events (CheckPassportEvent, LoginSuccessEvent, LoginFailureEvent) that does what an omniauth listener does skips a passport that carries it.

public readonly Result $result

OmniauthBadge::__construct()

public function __construct(public readonly Result $result)

OmniauthBadge::isResolved()

public function isResolved(): bool

PendingToken class

final class PendingToken implements TokenInterface PendingToken.php:20

The visitor between two factors: omniauth found the account by a first factor and asks a second one (omniauth's Status::SecondFactorRequired).

Like scheb/2fa's TwoFactorToken, it is no AbstractToken: the firewall does not compare its (empty) roles with the account's at each request. It carries no role - nothing the account may do is granted to it - and is no full sign-in (PendingTrustResolver); PendingVoter answers IS_AUTHENTICATED_2FA_IN_PROGRESS for it alone, scheb/2fa's name, so an access_control line written for scheb/2fa's TwoFactorToken still opens the second factor's page, and that page only (SecondFactorGate sends every other request there).

PendingToken::__construct()

public function __construct(UserInterface $user, string $firewallName, array $offered = [])
$offered

the second factors the visitor may present (omniauth's Factor values)

PendingToken::getFirewallName()

public function getFirewallName(): string

PendingToken::offered()

public function offered(): array

PendingToken::__toString()

public function __toString(): string

PendingToken::getUserIdentifier()

public function getUserIdentifier(): string

PendingToken::getRoleNames()

public function getRoleNames(): array

None: nothing the account may do is granted before its second factor.

PendingToken::getUser()

public function getUser(): UserInterface

PendingToken::setUser()

public function setUser(UserInterface $user): void

PendingToken::eraseCredentials()

public function eraseCredentials(): void

PendingToken::getAttributes()

public function getAttributes(): array

PendingToken::setAttributes()

public function setAttributes(array $attributes): void

PendingToken::hasAttribute()

public function hasAttribute(string $name): bool

PendingToken::getAttribute()

public function getAttribute(string $name): mixed

PendingToken::setAttribute()

public function setAttribute(string $name, mixed $value): void

PendingToken::__serialize()

public function __serialize(): array

PendingToken::__unserialize()

public function __unserialize(array $data): void

PendingTrustResolver class

final class PendingTrustResolver implements AuthenticationTrustResolverInterface PendingTrustResolver.php:13

Security's trust resolver, for which the visitor between two factors (PendingToken) is never fully signed in: IS_AUTHENTICATED_FULLY is refused to it, as scheb/2fa's resolver refuses it to its TwoFactorToken.

PendingTrustResolver::__construct()

public function __construct(readonly AuthenticationTrustResolverInterface $inner)

PendingTrustResolver::isAuthenticated()

public function isAuthenticated(?TokenInterface $token = null): bool

PendingTrustResolver::isRememberMe()

public function isRememberMe(?TokenInterface $token = null): bool

PendingTrustResolver::isFullFledged()

public function isFullFledged(?TokenInterface $token = null): bool

PendingVoter class

final class PendingVoter implements CacheableVoterInterface PendingVoter.php:15

IS_AUTHENTICATED_2FA_IN_PROGRESS - scheb/2fa's attribute, under the same name - granted to the visitor between two factors (PendingToken) and to nobody else: neither a visitor signed out nor one signed in opens the second factor's page.

const IS_AUTHENTICATED_2FA_IN_PROGRESS = 'IS_AUTHENTICATED_2FA_IN_PROGRESS'

PendingVoter::vote()

public function vote(TokenInterface $token, mixed $subject, array $attributes, mixed $vote = null): int

PendingVoter::supportsAttribute()

public function supportsAttribute(string $attribute): bool

PendingVoter::supportsType()

public function supportsType(string $subjectType): bool

SecondFactorGate class

final class SecondFactorGate implements EventSubscriberInterface SecondFactorGate.php:30

Between two factors, the second factor's page and nothing else: the visitor holding a PendingToken is sent there from any page, as scheb/2fa's TwoFactorAccessListener and its redirection did - but a page access_control opens to everybody (PUBLIC_ACCESS) or to that token (IS_AUTHENTICATED_2FA_IN_PROGRESS), and the sign-out.

Twice: after the firewall (a page access_control does not guard, which Security lets through), and when Security refused a page (the access denied, which would otherwise start a sign-in from scratch).

SecondFactorGate::__construct()

public function __construct(readonly TokenStorageInterface $tokens, readonly UrlGeneratorInterface $urls, readonly string $formRoute, readonly array $routes = [], readonly ?AccessMapInterface $accessMap = null, readonly ?AccessDecisionManagerInterface $decisions = null, readonly ?LogoutUrlGenerator $logout = null)
$routes

the second factor's own routes (its page, its check)

SecondFactorGate::getSubscribedEvents()

public static function getSubscribedEvents(): array

SecondFactorGate::onRequest()

public function onRequest(RequestEvent $event): void

SecondFactorGate::onException()

public function onException(ExceptionEvent $event): void

SessionState class

final class SessionState implements State SessionState.php:13

omniauth's State under Symfony: the visitor's session (the request's, through the request stack). Without a session - a command, a request without one - nothing is kept.

SessionState::__construct()

public function __construct(readonly RequestStack $requests)

SessionState::get()

public function get(string $key): mixed

SessionState::set()

public function set(string $key, mixed $value): void

SessionState::remove()

public function remove(string $key): void

Omnibridge\Symfony\Auth\DependencyInjection

Configuration class

final class Configuration implements ConfigurationInterface Configuration.php:18

omniauth.yaml (plan "omniauth", §4.1): the methods mounted - each present key turns its method on, a method whose package is missing cannot be -, their settings, the stores (service ids, by default each contract's own name), where the forms post and what their fields are called, the routes of the ceremonies, the throttle and the pages' messages.

Configuration::getConfigTreeBuilder()

public function getConfigTreeBuilder(): TreeBuilder

OmniauthExtension class

final class OmniauthExtension extends Extension OmniauthExtension.php:71

omniauth wired into a Symfony application (plan "omniauth", §3.1, step AU6), from config/packages/omniauth.yaml: the conductor (Omniauth\Omniauth) with the methods present - each key turns its method on; passkeys and TOTP need their package (omniauth/webauthn, omniauth/otp), an identity provider its own (omniauth/google) -, the TOTP secrets sealed at rest when totp.secret_key is set (omniauth/otp's SodiumSecretBox decorating the TotpSecrets store, so whoever reads the store - the method, an enrolment page - reads through it), the second-factor rule (EnrolledSecondFactors, which an application decorates: Omniauth\Contract\SecondFactorPolicy), the session as its State, a PSR-6 pool as its Throttle, Symfony's dispatcher for its events; and around it, the authenticator a firewall names (custom_authenticator: Omnibridge\Symfony\Auth\OmniauthAuthenticator), the second factor's token, voter, trust resolver and gate, the ceremonies' controller and routes (type "omniauth").

The stores are the application's: each contract by its own name, or the service omniauth.yaml's "stores" names (omnibase binds its Base\Auth\ ones).

Registered by OmnibridgeBundle, and by an application's own bundle with register() (omnibase's BaseBundle), only where omniauth is installed; with no omniauth.yaml (or one without any key), it loads nothing.

const METHOD = 'omniauth.method'
const SECOND_FACTOR = 'omniauth.second_factor'
const POLICY = 'omniauth.policy.default'
const PROVIDERS = 'omniauth.oauth.providers'
const PROVIDER_FACTORY = 'omniauth.oauth_provider_factory'

OmniauthExtension::register()

public static function register(ContainerBuilder $container): void

Registers this extension in a container being built, when omniauth is installed.

OmniauthExtension::getAlias()

public function getAlias(): string

OmniauthExtension::load()

public function load(array $configs, ContainerBuilder $container): void

Omnibridge\Symfony\Auth\Exception

SignInRefused class

final class SignInRefused extends CustomUserMessageAuthenticationException SignInRefused.php:16

An attempt omniauth (or the bridge, for a CSRF token) refused: the factor, omniauth's stable failure and reason, and the message the page translates (OmniauthAuthenticator's messages). IdentityUnknown is one too: a provider vouched for someone no account is linked to ($identity).

public readonly Factor $factor
public readonly ?Failure $failure
public readonly ?string $reason
public readonly ?PendingIdentity $identity

SignInRefused::__construct()

public function __construct(public readonly Factor $factor, public readonly ?Failure $failure, string $message, array $messageData = [], public readonly ?string $reason = null, public readonly ?PendingIdentity $identity = null)

Omnibridge\Symfony\Contract

CsrfTokens class

final class CsrfTokens implements Tokens CsrfTokens.php:17

Omnibridge\Contract\Tokens under Symfony: the CSRF token manager's token of an intent - what Twig's csrf_token() prints -, and its check, the one AbstractController::isCsrfTokenValid() makes.

Moved from omnisense/omnibase's Base\Bridge\Symfony\CsrfTokens (plan "omnibase agnostique", A1); the former name is an alias of this class.

CsrfTokens::__construct()

public function __construct(readonly CsrfTokenManagerInterface $manager)

CsrfTokens::csrf()

public function csrf(string $intent): string

CsrfTokens::isValid()

public function isValid(string $intent, ?string $token): bool

KernelEnvironment class

final class KernelEnvironment implements Environment KernelEnvironment.php:15

Omnibridge\Contract\Environment under Symfony: the kernel's environment, debug and secret - the container's kernel.environment, kernel.debug and kernel.secret.

Moved from omnisense/omnibase's Base\Bridge\Symfony\KernelEnvironment (plan "omnibase agnostique", A1); the former name is an alias of this class.

KernelEnvironment::__construct()

public function __construct(readonly string $environment, readonly bool $debug, readonly string $secret)

KernelEnvironment::name()

public function name(): string

KernelEnvironment::isDebug()

public function isDebug(): bool

KernelEnvironment::secret()

public function secret(): string

SecurityAccess class

final class SecurityAccess implements Access SecurityAccess.php:17

Omnibridge\Contract\Access under Symfony: Security's authorization checker (the role hierarchy, the application's voters) and token storage - the answers of Twig's is_granted() and app.user.

Moved from omnisense/omnibase's Base\Bridge\Symfony\SecurityAccess (plan "omnibase agnostique", A1); the former name is an alias of this class.

SecurityAccess::__construct()

public function __construct(readonly AuthorizationCheckerInterface $authorizationChecker, readonly TokenStorageInterface $tokenStorage)

SecurityAccess::isGranted()

public function isGranted(mixed $attribute, mixed $subject = null): bool

SecurityAccess::getUser()

public function getUser(): ?object

SecuritySessions class

final class SecuritySessions implements Sessions SecuritySessions.php:18

Omnibridge\Contract\Sessions under Symfony: Security's token storage - the token forgotten when its user is the one signed out - and the REMEMBERME cookie cleared on the path and, when the application says which, on its domain ($domain, asked at sign-out: omnibase gives its router's domain).

Moved from omnisense/omnibase's Base\Bridge\Symfony\SecuritySessions (plan "omnibase agnostique", A1), which took omnibase's router for that domain; the former name is an alias of this class.

SecuritySessions::__construct()

public function __construct(readonly TokenStorageInterface $tokenStorage, readonly ?\Closure $domain = null)
$domain

the domain of the remember-me cookie

SecuritySessions::signOut()

public function signOut(object $user): bool

Omnibridge\Symfony\DependencyInjection

ContractsPass class

class ContractsPass implements CompilerPassInterface ContractsPass.php:45

The locator Omnibridge\Runtime reaches the host's contracts through under Symfony, handed to it at boot (OmnibridgeBundle::boot(), or the bundle of an application that runs this pass with its own list - omnibase's BaseBundle): each contract by its interface's name, the service the container binds to that name - this package's adapters (config/services.php), the framework's clock and event dispatcher, or an application's own binding, which wins as any alias does.

Only the contracts whose service exists are listed (no clock without symfony/clock, no Access without SecurityBundle): the registry says it has none rather than failing when the service is built. An adapter of this package (tagged omnibridge.adapter) whose framework service is missing - SecurityAccess in an application without SecurityBundle, CsrfTokens without CSRF protection - is removed with the aliases that lead to it, so a container without them still compiles. A locator holds closures: nothing is constructed before a contract is asked.

Moved from omnisense/omnibase's Base\DependencyInjection\Compiler\Pass\ContractsPass (plan "omnibase agnostique", A1), which now runs this one with omnibase's own contracts added.

const SERVICE = 'omnibridge.contracts'
const ADAPTER = 'omnibridge.adapter'

The tag of this package's adapters: removed when a service they need is missing.

const CONTRACTS = [Urls::class, Routes::class, Environment::class, Translations::class, Access::class, Sessions::class, Locales::class, Files::class, Tokens::class, ClockInter…

ContractsPass::__construct()

public function __construct(readonly array $contracts = self::CONTRACTS, readonly array $services = [], readonly array $former = [], readonly string $id = self::SERVICE)
$contracts

the names the locator answers

$services

a contract bound to another service than its name

$former

a former name => the contract it is listed as, the same service

$id

the locator's service id

ContractsPass::process()

public function process(ContainerBuilder $container): void

Omnibridge\Symfony\Map

MapRouteLoader class

final class MapRouteLoader extends Loader MapRouteLoader.php:16

The map cache's routes, at the paths and under the names omnimap.yaml gives (routes): a tile (GET), a picture's metadata (GET), the export of a captured picture and its deletion (POST). An application imports them:

omnimap: { resource: ., type: omnimap }

const TYPE = 'omnimap'

MapRouteLoader::__construct()

public function __construct(readonly array $routes, ?string $env = null)

MapRouteLoader::load()

public function load(mixed $resource, ?string $type = null): RouteCollection

MapRouteLoader::supports()

public function supports(mixed $resource, ?string $type = null): bool

SnapshotController class

final class SnapshotController SnapshotController.php:31

The map cache over HTTP (MapRouteLoader's routes):

  • tile: a tile of a picture kept, as WebP when the route's path ends in .webp (fitted within public_size; GD with WebP, else Imagick, else as kept), public and cacheable (max_age); with a public_directory, written there too at the route's own path, so the web server serves it without PHP the next time;
  • metadata: the picture's metadata as JSON ({"status": "BAD"} when none);
  • export: a picture captured by the browser (image: a data: URL, tilesize), for whoever has the control attribute, with the "omnimap-export" token;
  • suppress: the picture deleted, and its tiles written in the public directory with it (ux-google left them served), for the same, with the "omnimap-suppress" token.

SnapshotController::__construct()

public function __construct(readonly Snapshots $snapshots, readonly ?Access $access, readonly ?Tokens $tokens, readonly string $control, readonly string $tilePath, readonly ?string $publicDirectory, readonly ?int $publicSize, readonly int $maxAge, readonly ?int $tilesize)

SnapshotController::tile()

public function tile(string $signature, int $id, Request $request): Response

SnapshotController::metadata()

public function metadata(string $signature): JsonResponse

SnapshotController::export()

public function export(string $signature, Request $request): JsonResponse

SnapshotController::suppress()

public function suppress(string $signature, Request $request): JsonResponse

Omnibridge\Symfony\Map\DependencyInjection

Configuration class

final class Configuration implements ConfigurationInterface Configuration.php:24

config/packages/omnimap.yaml:

omnimap: provider: openstreetmap # the provider of the page's map: a key of providers secret: '%env(MAP_SECRET)%' # signs the pictures' names (URL-safe base64) providers: google: { api_key: '...', server_key: '...', secret: '...', legacy_signature: true } openstreetmap: { user_agent: 'MySite/1.0 (+https://example.org)' } cache: drive: local.uploads # an omnidrive drive (Omnidrive\Drives); or storage: a service implementing Omnimap\Snapshot\Storage routes: tile: { path: '/omnimap/{signature}/{id}.webp' }

Every provider's options are its factory's (omnimap/google, omnimap/openstreetmap).

Configuration::getConfigTreeBuilder()

public function getConfigTreeBuilder(): TreeBuilder

OmnimapExtension class

final class OmnimapExtension extends Extension OmnimapExtension.php:53

omnisense/omnimap wired into a Symfony application, from config/packages/omnimap.yaml (Configuration): the providers installed (omnimap/google, omnimap/openstreetmap, omnimap/maplibre; any other by the tag omnimap.provider_factory) over the application's HTTP client, a PSR-16 view of its cache pool and, for geocoder-php, a PSR-18 client; the Registry; the map cache (SnapshotStore on an omnidrive drive - cache.drive, of the application's Omnidrive\Drives - or on a Storage service, Snapshots, the server's own pictures when the provider makes images); MapPrinter and omnibridge/twig's MapExtension (omnimap(), omnimap_export(), omnimap_suppress()); the cache's routes (type "omnimap") and their controller.

Services by their class: Omnimap\Registry, Omnimap\Snapshot\Snapshots, Omnimap\MapPrinter, Omnimap\MapRendererInterface (the page's provider), Omnimap\GeocoderInterface (the provider "geocoder" names, the page's by default).

Registered by OmnibridgeBundle where omnimap is installed; with no omnimap.yaml, it loads nothing.

const FACTORY = 'omnimap.provider_factory'
const FACTORIES = ['Omnimap\Google\GoogleFactory' => 3, 'Omnimap\OpenStreetMap\OpenStreetMapFactory' => 3, 'Omnimap\MapLibre\MapLibreFactory' => 1]

The omnimap/* providers' factories registered when installed, with how many of (HTTP client, PSR-18 client, PSR-16 cache) each takes. Another provider's factory is the application's service tagged FACTORY.

OmnimapExtension::register()

public static function register(ContainerBuilder $container): void

Registers this extension in a container being built, when omnimap is installed.

OmnimapExtension::getAlias()

public function getAlias(): string

OmnimapExtension::load()

public function load(array $configs, ContainerBuilder $container): void

OmnimapExtension::staticMap()

public static function staticMap(Registry $registry, string $provider, bool $required): ?StaticMapInterface

The page's provider as a static map: required (make: true), or when it has the capability (auto).

OmnimapExtension::logger()

public static function logger(?LoggerInterface $logger): \Closure

Omnibridge\Symfony\Static

BuildCommand class

final class BuildCommand extends Command BuildCommand.php:28

omnibridge/static's build under Symfony: the same Console\Cli as the plain command line, handed what this host offers the site's file - a renderer through this kernel's own request handling (each page a visitor's GET, at --render-origin, by default the router's default URI), the router's routes, the container, the public folder.

bin/console omnibridge:static:build static.php --out=var/static [--verify] [--strict]

Registered by config/services.php only where omnibridge/static is installed.

BuildCommand::__construct()

public function __construct(readonly KernelInterface $kernel, readonly RouterInterface $router)