api/laravel/Auth/SessionGuard.yaml

835 lines
20 KiB
YAML
Raw Normal View History

2024-09-26 09:03:21 +00:00
name: SessionGuard
class_comment: null
dependencies:
- name: Attempting
type: class
source: Illuminate\Auth\Events\Attempting
- name: Authenticated
type: class
source: Illuminate\Auth\Events\Authenticated
- name: CurrentDeviceLogout
type: class
source: Illuminate\Auth\Events\CurrentDeviceLogout
- name: Failed
type: class
source: Illuminate\Auth\Events\Failed
- name: Login
type: class
source: Illuminate\Auth\Events\Login
- name: Logout
type: class
source: Illuminate\Auth\Events\Logout
- name: OtherDeviceLogout
type: class
source: Illuminate\Auth\Events\OtherDeviceLogout
- name: Validated
type: class
source: Illuminate\Auth\Events\Validated
- name: AuthenticatableContract
type: class
source: Illuminate\Contracts\Auth\Authenticatable
- name: StatefulGuard
type: class
source: Illuminate\Contracts\Auth\StatefulGuard
- name: SupportsBasicAuth
type: class
source: Illuminate\Contracts\Auth\SupportsBasicAuth
- name: UserProvider
type: class
source: Illuminate\Contracts\Auth\UserProvider
- name: CookieJar
type: class
source: Illuminate\Contracts\Cookie\QueueingFactory
- name: Dispatcher
type: class
source: Illuminate\Contracts\Events\Dispatcher
- name: Session
type: class
source: Illuminate\Contracts\Session\Session
- name: Arr
type: class
source: Illuminate\Support\Arr
- name: Hash
type: class
source: Illuminate\Support\Facades\Hash
- name: Str
type: class
source: Illuminate\Support\Str
- name: Timebox
type: class
source: Illuminate\Support\Timebox
- name: Macroable
type: class
source: Illuminate\Support\Traits\Macroable
- name: InvalidArgumentException
type: class
source: InvalidArgumentException
- name: RuntimeException
type: class
source: RuntimeException
- name: Request
type: class
source: Symfony\Component\HttpFoundation\Request
- name: UnauthorizedHttpException
type: class
source: Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException
properties:
- name: lastAttempted
visibility: protected
comment: "# * The name of the guard. Typically \"web\".\n# *\n# * Corresponds to\
\ guard name in authentication configuration.\n# *\n# * @var string\n# */\n# public\
\ readonly string $name;\n# \n# /**\n# * The user we last attempted to retrieve.\n\
# *\n# * @var \\Illuminate\\Contracts\\Auth\\Authenticatable"
- name: viaRemember
visibility: protected
comment: '# * Indicates if the user was authenticated via a recaller cookie.
# *
# * @var bool'
- name: rememberDuration
visibility: protected
comment: '# * The number of minutes that the "remember me" cookie should be valid
for.
# *
# * @var int'
- name: session
visibility: protected
comment: '# * The session used by the guard.
# *
# * @var \Illuminate\Contracts\Session\Session'
- name: cookie
visibility: protected
comment: '# * The Illuminate cookie creator service.
# *
# * @var \Illuminate\Contracts\Cookie\QueueingFactory'
- name: request
visibility: protected
comment: '# * The request instance.
# *
# * @var \Symfony\Component\HttpFoundation\Request'
- name: events
visibility: protected
comment: '# * The event dispatcher instance.
# *
# * @var \Illuminate\Contracts\Events\Dispatcher'
- name: timebox
visibility: protected
comment: '# * The timebox instance.
# *
# * @var \Illuminate\Support\Timebox'
- name: rehashOnLogin
visibility: protected
comment: '# * Indicates if passwords should be rehashed on login if needed.
# *
# * @var bool'
- name: loggedOut
visibility: protected
comment: '# * Indicates if the logout method has been called.
# *
# * @var bool'
- name: recallAttempted
visibility: protected
comment: '# * Indicates if a token user retrieval has been attempted.
# *
# * @var bool'
methods:
- name: __construct
visibility: public
parameters:
- name: name
- name: provider
- name: session
- name: request
default: 'null'
- name: timebox
default: 'null'
- name: rehashOnLogin
default: 'true'
comment: "# * The name of the guard. Typically \"web\".\n# *\n# * Corresponds to\
\ guard name in authentication configuration.\n# *\n# * @var string\n# */\n# public\
\ readonly string $name;\n# \n# /**\n# * The user we last attempted to retrieve.\n\
# *\n# * @var \\Illuminate\\Contracts\\Auth\\Authenticatable\n# */\n# protected\
\ $lastAttempted;\n# \n# /**\n# * Indicates if the user was authenticated via\
\ a recaller cookie.\n# *\n# * @var bool\n# */\n# protected $viaRemember = false;\n\
# \n# /**\n# * The number of minutes that the \"remember me\" cookie should be\
\ valid for.\n# *\n# * @var int\n# */\n# protected $rememberDuration = 576000;\n\
# \n# /**\n# * The session used by the guard.\n# *\n# * @var \\Illuminate\\Contracts\\\
Session\\Session\n# */\n# protected $session;\n# \n# /**\n# * The Illuminate cookie\
\ creator service.\n# *\n# * @var \\Illuminate\\Contracts\\Cookie\\QueueingFactory\n\
# */\n# protected $cookie;\n# \n# /**\n# * The request instance.\n# *\n# * @var\
\ \\Symfony\\Component\\HttpFoundation\\Request\n# */\n# protected $request;\n\
# \n# /**\n# * The event dispatcher instance.\n# *\n# * @var \\Illuminate\\Contracts\\\
Events\\Dispatcher\n# */\n# protected $events;\n# \n# /**\n# * The timebox instance.\n\
# *\n# * @var \\Illuminate\\Support\\Timebox\n# */\n# protected $timebox;\n# \n\
# /**\n# * Indicates if passwords should be rehashed on login if needed.\n# *\n\
# * @var bool\n# */\n# protected $rehashOnLogin;\n# \n# /**\n# * Indicates if\
\ the logout method has been called.\n# *\n# * @var bool\n# */\n# protected $loggedOut\
\ = false;\n# \n# /**\n# * Indicates if a token user retrieval has been attempted.\n\
# *\n# * @var bool\n# */\n# protected $recallAttempted = false;\n# \n# /**\n#\
\ * Create a new authentication guard.\n# *\n# * @param string $name\n# * @param\
\ \\Illuminate\\Contracts\\Auth\\UserProvider $provider\n# * @param \\Illuminate\\\
Contracts\\Session\\Session $session\n# * @param \\Symfony\\Component\\HttpFoundation\\\
Request|null $request\n# * @param \\Illuminate\\Support\\Timebox|null $timebox\n\
# * @param bool $rehashOnLogin\n# * @return void"
- name: user
visibility: public
parameters: []
comment: '# * Get the currently authenticated user.
# *
# * @return \Illuminate\Contracts\Auth\Authenticatable|null'
- name: userFromRecaller
visibility: protected
parameters:
- name: recaller
comment: '# * Pull a user from the repository by its "remember me" cookie token.
# *
# * @param \Illuminate\Auth\Recaller $recaller
# * @return mixed'
- name: recaller
visibility: protected
parameters: []
comment: '# * Get the decrypted recaller cookie for the request.
# *
# * @return \Illuminate\Auth\Recaller|null'
- name: id
visibility: public
parameters: []
comment: '# * Get the ID for the currently authenticated user.
# *
# * @return int|string|null'
- name: once
visibility: public
parameters:
- name: credentials
default: '[]'
comment: '# * Log a user into the application without sessions or cookies.
# *
# * @param array $credentials
# * @return bool'
- name: onceUsingId
visibility: public
parameters:
- name: id
comment: '# * Log the given user ID into the application without sessions or cookies.
# *
# * @param mixed $id
# * @return \Illuminate\Contracts\Auth\Authenticatable|false'
- name: validate
visibility: public
parameters:
- name: credentials
default: '[]'
comment: '# * Validate a user''s credentials.
# *
# * @param array $credentials
# * @return bool'
- name: basic
visibility: public
parameters:
- name: field
default: '''email'''
- name: extraConditions
default: '[]'
comment: '# * Attempt to authenticate using HTTP Basic Auth.
# *
# * @param string $field
# * @param array $extraConditions
# * @return \Symfony\Component\HttpFoundation\Response|null
# *
# * @throws \Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException'
- name: onceBasic
visibility: public
parameters:
- name: field
default: '''email'''
- name: extraConditions
default: '[]'
comment: '# * Perform a stateless HTTP Basic login attempt.
# *
# * @param string $field
# * @param array $extraConditions
# * @return \Symfony\Component\HttpFoundation\Response|null
# *
# * @throws \Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException'
- name: attemptBasic
visibility: protected
parameters:
- name: request
- name: field
- name: extraConditions
default: '[]'
comment: '# * Attempt to authenticate using basic authentication.
# *
# * @param \Symfony\Component\HttpFoundation\Request $request
# * @param string $field
# * @param array $extraConditions
# * @return bool'
- name: basicCredentials
visibility: protected
parameters:
- name: request
- name: field
comment: '# * Get the credential array for an HTTP Basic request.
# *
# * @param \Symfony\Component\HttpFoundation\Request $request
# * @param string $field
# * @return array'
- name: failedBasicResponse
visibility: protected
parameters: []
comment: '# * Get the response for basic authentication.
# *
# * @return void
# *
# * @throws \Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException'
- name: attempt
visibility: public
parameters:
- name: credentials
default: '[]'
- name: remember
default: 'false'
comment: '# * Attempt to authenticate a user using the given credentials.
# *
# * @param array $credentials
# * @param bool $remember
# * @return bool'
- name: attemptWhen
visibility: public
parameters:
- name: credentials
default: '[]'
- name: callbacks
default: 'null'
- name: remember
default: 'false'
comment: '# * Attempt to authenticate a user with credentials and additional callbacks.
# *
# * @param array $credentials
# * @param array|callable|null $callbacks
# * @param bool $remember
# * @return bool'
- name: hasValidCredentials
visibility: protected
parameters:
- name: user
- name: credentials
comment: '# * Determine if the user matches the credentials.
# *
# * @param mixed $user
# * @param array $credentials
# * @return bool'
- name: shouldLogin
visibility: protected
parameters:
- name: callbacks
- name: user
comment: '# * Determine if the user should login by executing the given callbacks.
# *
# * @param array|callable|null $callbacks
# * @param \Illuminate\Contracts\Auth\Authenticatable $user
# * @return bool'
- name: rehashPasswordIfRequired
visibility: protected
parameters:
- name: user
- name: credentials
comment: '# * Rehash the user''s password if enabled and required.
# *
# * @param \Illuminate\Contracts\Auth\Authenticatable $user
# * @param array $credentials
# * @return void'
- name: loginUsingId
visibility: public
parameters:
- name: id
- name: remember
default: 'false'
comment: '# * Log the given user ID into the application.
# *
# * @param mixed $id
# * @param bool $remember
# * @return \Illuminate\Contracts\Auth\Authenticatable|false'
- name: login
visibility: public
parameters:
- name: user
- name: remember
default: 'false'
comment: '# * Log a user into the application.
# *
# * @param \Illuminate\Contracts\Auth\Authenticatable $user
# * @param bool $remember
# * @return void'
- name: updateSession
visibility: protected
parameters:
- name: id
comment: '# * Update the session with the given ID.
# *
# * @param string $id
# * @return void'
- name: ensureRememberTokenIsSet
visibility: protected
parameters:
- name: user
comment: '# * Create a new "remember me" token for the user if one doesn''t already
exist.
# *
# * @param \Illuminate\Contracts\Auth\Authenticatable $user
# * @return void'
- name: queueRecallerCookie
visibility: protected
parameters:
- name: user
comment: '# * Queue the recaller cookie into the cookie jar.
# *
# * @param \Illuminate\Contracts\Auth\Authenticatable $user
# * @return void'
- name: createRecaller
visibility: protected
parameters:
- name: value
comment: '# * Create a "remember me" cookie for a given ID.
# *
# * @param string $value
# * @return \Symfony\Component\HttpFoundation\Cookie'
- name: logout
visibility: public
parameters: []
comment: '# * Log the user out of the application.
# *
# * @return void'
- name: logoutCurrentDevice
visibility: public
parameters: []
comment: '# * Log the user out of the application on their current device only.
# *
# * This method does not cycle the "remember" token.
# *
# * @return void'
- name: clearUserDataFromStorage
visibility: protected
parameters: []
comment: '# * Remove the user data from the session and cookies.
# *
# * @return void'
- name: cycleRememberToken
visibility: protected
parameters:
- name: user
comment: '# * Refresh the "remember me" token for the user.
# *
# * @param \Illuminate\Contracts\Auth\Authenticatable $user
# * @return void'
- name: logoutOtherDevices
visibility: public
parameters:
- name: password
comment: '# * Invalidate other sessions for the current user.
# *
# * The application must be using the AuthenticateSession middleware.
# *
# * @param string $password
# * @return \Illuminate\Contracts\Auth\Authenticatable|null
# *
# * @throws \Illuminate\Auth\AuthenticationException'
- name: rehashUserPasswordForDeviceLogout
visibility: protected
parameters:
- name: password
comment: '# * Rehash the current user''s password for logging out other devices
via AuthenticateSession.
# *
# * @param string $password
# * @return \Illuminate\Contracts\Auth\Authenticatable|null
# *
# * @throws \InvalidArgumentException'
- name: attempting
visibility: public
parameters:
- name: callback
comment: '# * Register an authentication attempt event listener.
# *
# * @param mixed $callback
# * @return void'
- name: fireAttemptEvent
visibility: protected
parameters:
- name: credentials
- name: remember
default: 'false'
comment: '# * Fire the attempt event with the arguments.
# *
# * @param array $credentials
# * @param bool $remember
# * @return void'
- name: fireValidatedEvent
visibility: protected
parameters:
- name: user
comment: '# * Fires the validated event if the dispatcher is set.
# *
# * @param \Illuminate\Contracts\Auth\Authenticatable $user
# * @return void'
- name: fireLoginEvent
visibility: protected
parameters:
- name: user
- name: remember
default: 'false'
comment: '# * Fire the login event if the dispatcher is set.
# *
# * @param \Illuminate\Contracts\Auth\Authenticatable $user
# * @param bool $remember
# * @return void'
- name: fireAuthenticatedEvent
visibility: protected
parameters:
- name: user
comment: '# * Fire the authenticated event if the dispatcher is set.
# *
# * @param \Illuminate\Contracts\Auth\Authenticatable $user
# * @return void'
- name: fireOtherDeviceLogoutEvent
visibility: protected
parameters:
- name: user
comment: '# * Fire the other device logout event if the dispatcher is set.
# *
# * @param \Illuminate\Contracts\Auth\Authenticatable $user
# * @return void'
- name: fireFailedEvent
visibility: protected
parameters:
- name: user
- name: credentials
comment: '# * Fire the failed authentication attempt event with the given arguments.
# *
# * @param \Illuminate\Contracts\Auth\Authenticatable|null $user
# * @param array $credentials
# * @return void'
- name: getLastAttempted
visibility: public
parameters: []
comment: '# * Get the last user we attempted to authenticate.
# *
# * @return \Illuminate\Contracts\Auth\Authenticatable'
- name: getName
visibility: public
parameters: []
comment: '# * Get a unique identifier for the auth session value.
# *
# * @return string'
- name: getRecallerName
visibility: public
parameters: []
comment: '# * Get the name of the cookie used to store the "recaller".
# *
# * @return string'
- name: viaRemember
visibility: public
parameters: []
comment: '# * Determine if the user was authenticated via "remember me" cookie.
# *
# * @return bool'
- name: getRememberDuration
visibility: protected
parameters: []
comment: '# * Get the number of minutes the remember me cookie should be valid for.
# *
# * @return int'
- name: setRememberDuration
visibility: public
parameters:
- name: minutes
comment: '# * Set the number of minutes the remember me cookie should be valid for.
# *
# * @param int $minutes
# * @return $this'
- name: getCookieJar
visibility: public
parameters: []
comment: '# * Get the cookie creator instance used by the guard.
# *
# * @return \Illuminate\Contracts\Cookie\QueueingFactory
# *
# * @throws \RuntimeException'
- name: setCookieJar
visibility: public
parameters:
- name: cookie
comment: '# * Set the cookie creator instance used by the guard.
# *
# * @param \Illuminate\Contracts\Cookie\QueueingFactory $cookie
# * @return void'
- name: getDispatcher
visibility: public
parameters: []
comment: '# * Get the event dispatcher instance.
# *
# * @return \Illuminate\Contracts\Events\Dispatcher'
- name: setDispatcher
visibility: public
parameters:
- name: events
comment: '# * Set the event dispatcher instance.
# *
# * @param \Illuminate\Contracts\Events\Dispatcher $events
# * @return void'
- name: getSession
visibility: public
parameters: []
comment: '# * Get the session store used by the guard.
# *
# * @return \Illuminate\Contracts\Session\Session'
- name: getUser
visibility: public
parameters: []
comment: '# * Return the currently cached user.
# *
# * @return \Illuminate\Contracts\Auth\Authenticatable|null'
- name: setUser
visibility: public
parameters:
- name: user
comment: '# * Set the current user.
# *
# * @param \Illuminate\Contracts\Auth\Authenticatable $user
# * @return $this'
- name: getRequest
visibility: public
parameters: []
comment: '# * Get the current request instance.
# *
# * @return \Symfony\Component\HttpFoundation\Request'
- name: setRequest
visibility: public
parameters:
- name: request
comment: '# * Set the current request instance.
# *
# * @param \Symfony\Component\HttpFoundation\Request $request
# * @return $this'
- name: getTimebox
visibility: public
parameters: []
comment: '# * Get the timebox instance used by the guard.
# *
# * @return \Illuminate\Support\Timebox'
traits:
- Illuminate\Auth\Events\Attempting
- Illuminate\Auth\Events\Authenticated
- Illuminate\Auth\Events\CurrentDeviceLogout
- Illuminate\Auth\Events\Failed
- Illuminate\Auth\Events\Login
- Illuminate\Auth\Events\Logout
- Illuminate\Auth\Events\OtherDeviceLogout
- Illuminate\Auth\Events\Validated
- Illuminate\Contracts\Auth\StatefulGuard
- Illuminate\Contracts\Auth\SupportsBasicAuth
- Illuminate\Contracts\Auth\UserProvider
- Illuminate\Contracts\Events\Dispatcher
- Illuminate\Contracts\Session\Session
- Illuminate\Support\Arr
- Illuminate\Support\Facades\Hash
- Illuminate\Support\Str
- Illuminate\Support\Timebox
- Illuminate\Support\Traits\Macroable
- InvalidArgumentException
- RuntimeException
- Symfony\Component\HttpFoundation\Request
- Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException
- GuardHelpers
interfaces:
- StatefulGuard