Skip to content
Snippets Groups Projects
Select Git revision
  • bdc54d89a521c81d747fd6d47fa19fe1ad67292f
  • main default protected
  • register-logging-channel
  • expr-lang
  • ci-82
  • attr-events
  • locale-wip
  • custom-routes
  • v0.1.85
  • v0.1.84
  • v0.1.83
  • v0.1.82
  • v0.1.81
  • v0.1.80
  • v0.1.79
  • v0.1.78
  • v0.1.77
  • v0.1.76
  • v0.1.75
  • v0.1.74
  • v0.1.73
  • v0.1.72
  • v0.1.71
  • v0.1.70
  • v0.1.69
  • v0.1.68
  • v0.1.67
  • v0.1.65
28 results

UserSessionInterface.php

Blame
    • Reiter, Christoph's avatar
      7430fbcf
      Move the user session into the core · 7430fbcf
      Reiter, Christoph authored
      and remove roles and oidc specifics. Instead we provide the session
      in the core and forward requests to a oidc specific backend.
      
      This also means the session can provide useful values even in case
      it is used from the CLI and unauthenticated.
      7430fbcf
      History
      Move the user session into the core
      Reiter, Christoph authored
      and remove roles and oidc specifics. Instead we provide the session
      in the core and forward requests to a oidc specific backend.
      
      This also means the session can provide useful values even in case
      it is used from the CLI and unauthenticated.
    UserSessionInterface.php 1.52 KiB
    <?php
    
    declare(strict_types=1);
    
    namespace Dbp\Relay\CoreBundle\API;
    
    interface UserSessionInterface
    {
        /**
         * The unique identifier of the authenticated user. Or null in case it is called
         * before the user is known or if the user is a system.
         */
        public function getUserIdentifier(): ?string;
    
        /**
         * Returns an ID represents a "session" of a user which can be used for logging. It should not be possible to
         * figure out which user is behind the ID based on the ID itself and the ID should change regularly.
         * This is useful for connecting various requests together for logging while not exposing details about the user.
         */
        public function getSessionLoggingId(): string;
    
        /**
         * @deprecated
         */
        public function getUserRoles(): array;
    
        /**
         * Returns a unique caching key that can be used to cache metadata related to the current user session like
         * any user metadata, authorization related information etc.
         * It should not be possible to figure out which user is behind the ID based on the ID itself and the ID should
         * change regularly (after a logout/login or a key refresh for example).
         */
        public function getSessionCacheKey(): string;
    
        /**
         * Returns the duration the session is valid (as a whole, not from now) in seconds.
         * After the specified amount of time has passed the logging ID and the caching key should have changed.
         *
         * This is mostly useful for limiting the cache.
         */
        public function getSessionTTL(): int;
    }