NoAuthEndpoint
extends EndpointBase
in package
Allows an endpoint to not require any authorisation.
Tags
Table of Contents
Constants
- AUTH_TYPE_API_KEY = 'API Key'
- AUTH_TYPE_CUSTOM = 'Custom'
- AUTH_TYPE_NONE = 'None'
Properties
- $_description : string
- $_method : string
- $_module : string
- $_route : string
Methods
- customParams() : array<string|int, mixed>
- Allow auth methods to add custom params to endpoint.
- getAuthType() : string
- Get the authentication type of this Endpoint.
- getDescription() : string
- Get description of this Endpoint.
- getMethod() : string
- Get method of this Endpoint (either `POST` or `GET`).
- getModule() : string
- Get name of module of this Endpoint.
- getRoute() : string
- Get route of this Endpoint.
- isAuthorised() : bool
- Determine if this request is authorized to use this Endpoint.
Constants
AUTH_TYPE_API_KEY
public
mixed
AUTH_TYPE_API_KEY
= 'API Key'
AUTH_TYPE_CUSTOM
public
mixed
AUTH_TYPE_CUSTOM
= 'Custom'
AUTH_TYPE_NONE
public
mixed
AUTH_TYPE_NONE
= 'None'
Properties
$_description
protected
string
$_description
$_method
protected
string
$_method
$_module
protected
string
$_module
$_route
protected
string
$_route
Methods
customParams()
Allow auth methods to add custom params to endpoint.
public
customParams() : array<string|int, mixed>
Return values
array<string|int, mixed> —Custom endpoint params
getAuthType()
Get the authentication type of this Endpoint.
public
final getAuthType() : string
Determined by seeing what class it extends. Used to display in the API Endpoints StaffCP page.
Return values
string —The auth type.
getDescription()
Get description of this Endpoint.
public
final getDescription() : string
Return values
string —Endpoint's description.
getMethod()
Get method of this Endpoint (either `POST` or `GET`).
public
final getMethod() : string
Return values
string —Endpoint's method.
getModule()
Get name of module of this Endpoint.
public
final getModule() : string
Return values
string —Endpoint's modules name.
getRoute()
Get route of this Endpoint.
public
final getRoute() : string
Return values
string —Endpoint's route.
isAuthorised()
Determine if this request is authorized to use this Endpoint.
public
final isAuthorised(Nameless2API $api) : bool
Default implementations:
- NoAuthEndpoint to return true
- KeyAuthEndpoint to return true if the API key in header is valid.
Parameters
- $api : Nameless2API
-
Instance of Nameless2API.