GrantToken
extends Endpoint
in package
Table of Contents
Constants
- RESPONSE_IS_JSON = true
- PATH = '/v3/pam/%s/grant'
Properties
- $authorizedUuid : string
- $cachedTransports : array<string|int, mixed>
- $customHost : mixed
- $envelope : PNEnvelope
- $followRedirects : mixed
- $meta : mixed
- $patterns : array<string|int, string>
- $pubnub : PubNub
- $resources : array<string|int, string>
- $sortParams : bool
- $ttl : int
- $channels : mixed
- $groups : mixed
- $uuids : mixed
Methods
- __construct() : mixed
- addChannelGroupPatterns() : mixed
- addChannelGroupResources() : mixed
- addChannelPatterns() : mixed
- addChannelResources() : mixed
- addUuidPatterns() : mixed
- addUuidResources() : mixed
- authorizedUuid() : $this
- buildData() : null
- buildPath() : string
- channels() : $this
- clear() : mixed
- Clear cached envelope
- createResponse() : PNAccessManagerGrantResult
- customParams() : array<string|int, mixed>
- envelope() : PNEnvelope
- Returns an Envelope that contains both result and status.
- getConnectTimeout() : int
- getOperationType() : int
- getRequestTimeout() : int
- groups() : $this
- httpMethod() : string
- isAuthRequired() : bool
- meta() : mixed
- parseToken() : mixed
- sync() : PNAccessManagerGrantResult
- Return a Result only.
- ttl() : $this
- Set time in minutes for which granted permissions are valid
- uuids() : $this
- validateParams() : mixed
- buildParams() : array<string|int, mixed>
- Params build flow: signed <- custom <- default
- customHeaders() : mixed
- defaultHeaders() : mixed
- defaultParams() : array<string|int, mixed>
- fetchPayload() : array<string|int, mixed>
- getAffectedChannelGroups() : mixed
- getAffectedChannels() : mixed
- getAffectedUsers() : mixed
- getName() : string
- getTransport() : mixed
- invokeRequest() : PNEnvelope
- invokeRequestAndCacheIt() : PNEnvelope
- requestOptions() : array<string|int, mixed>
- validateChannelGroups() : mixed
- validatePublishKey() : mixed
- validateSecretKey() : mixed
- validateSubscribeKey() : mixed
- addPatterns() : mixed
- addResources() : mixed
- createStatus() : PNStatus
- getDefaultTransport() : Transport
- parsePermissions() : mixed
Constants
RESPONSE_IS_JSON
protected
mixed
RESPONSE_IS_JSON
= true
PATH
private
mixed
PATH
= '/v3/pam/%s/grant'
Properties
$authorizedUuid
protected
string
$authorizedUuid
$cachedTransports
protected
static array<string|int, mixed>
$cachedTransports
= []
$customHost
protected
mixed
$customHost
= null
$envelope
protected
PNEnvelope
$envelope
$followRedirects
protected
mixed
$followRedirects
= true
$meta
protected
mixed
$meta
$patterns
protected
array<string|int, string>
$patterns
= []
$pubnub
protected
PubNub
$pubnub
$resources
protected
array<string|int, string>
$resources
= []
$sortParams
protected
bool
$sortParams
= true
$ttl
protected
int
$ttl
$channels
private
mixed
$channels
= []
$groups
private
mixed
$groups
= []
$uuids
private
mixed
$uuids
= []
Methods
__construct()
public
__construct(PubNub $pubnubInstance) : mixed
Parameters
- $pubnubInstance : PubNub
addChannelGroupPatterns()
public
addChannelGroupPatterns(mixed $res) : mixed
Parameters
- $res : mixed
addChannelGroupResources()
public
addChannelGroupResources(mixed $res) : mixed
Parameters
- $res : mixed
addChannelPatterns()
public
addChannelPatterns(mixed $res) : mixed
Parameters
- $res : mixed
addChannelResources()
public
addChannelResources(mixed $res) : mixed
Parameters
- $res : mixed
addUuidPatterns()
public
addUuidPatterns(mixed $res) : mixed
Parameters
- $res : mixed
addUuidResources()
public
addUuidResources(mixed $res) : mixed
Parameters
- $res : mixed
authorizedUuid()
public
authorizedUuid(string $uuid) : $this
Parameters
- $uuid : string
Return values
$thisbuildData()
public
buildData() : null
Return values
nullbuildPath()
public
buildPath() : string
Return values
stringchannels()
public
channels(string|array<string|int, string> $channels) : $this
Parameters
- $channels : string|array<string|int, string>
Return values
$thisclear()
Clear cached envelope
public
clear() : mixed
createResponse()
public
createResponse(mixed $response) : PNAccessManagerGrantResult
Parameters
- $response : mixed
Return values
PNAccessManagerGrantResultcustomParams()
public
customParams() : array<string|int, mixed>
Return values
array<string|int, mixed>envelope()
Returns an Envelope that contains both result and status.
public
envelope() : PNEnvelope
All Errors are wrapped, so no need to use try/catch blocks
Return values
PNEnvelopegetConnectTimeout()
public
getConnectTimeout() : int
Return values
intgetOperationType()
public
getOperationType() : int
Return values
intgetRequestTimeout()
public
getRequestTimeout() : int
Return values
intgroups()
public
groups(string|array<string|int, string> $groups) : $this
Parameters
- $groups : string|array<string|int, string>
Return values
$thishttpMethod()
public
httpMethod() : string
Return values
stringisAuthRequired()
public
isAuthRequired() : bool
Return values
boolmeta()
public
meta(mixed $meta) : mixed
Parameters
- $meta : mixed
parseToken()
public
parseToken(mixed $token) : mixed
Parameters
- $token : mixed
sync()
Return a Result only.
public
sync() : PNAccessManagerGrantResult
Return values
PNAccessManagerGrantResultttl()
Set time in minutes for which granted permissions are valid
public
ttl(int $value) : $this
Max: 525600 Min: 1 Default: 1440
Setting 0 will apply the grant indefinitely (forever grant).
Parameters
- $value : int
Return values
$thisuuids()
public
uuids(string|array<string|int, string> $uuids) : $this
Parameters
- $uuids : string|array<string|int, string>
Return values
$thisvalidateParams()
public
validateParams() : mixed
Tags
buildParams()
Params build flow: signed <- custom <- default
protected
buildParams() : array<string|int, mixed>
Return values
array<string|int, mixed>customHeaders()
protected
customHeaders() : mixed
defaultHeaders()
protected
defaultHeaders() : mixed
defaultParams()
protected
defaultParams() : array<string|int, mixed>
Return values
array<string|int, mixed>fetchPayload()
protected
static fetchPayload(mixed $json) : array<string|int, mixed>
Parameters
- $json : mixed
Tags
Return values
array<string|int, mixed>getAffectedChannelGroups()
protected
getAffectedChannelGroups() : mixed
getAffectedChannels()
protected
getAffectedChannels() : mixed
getAffectedUsers()
protected
getAffectedUsers() : mixed
getName()
protected
getName() : string
Return values
stringgetTransport()
protected
getTransport() : mixed
invokeRequest()
protected
invokeRequest() : PNEnvelope
Return values
PNEnvelopeinvokeRequestAndCacheIt()
protected
invokeRequestAndCacheIt() : PNEnvelope
Tags
Return values
PNEnveloperequestOptions()
protected
requestOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>validateChannelGroups()
protected
validateChannelGroups(array<string|int, string>|string $channels, array<string|int, string>|string $groups) : mixed
Parameters
- $channels : array<string|int, string>|string
- $groups : array<string|int, string>|string
Tags
validatePublishKey()
protected
validatePublishKey() : mixed
Tags
validateSecretKey()
protected
validateSecretKey() : mixed
Tags
validateSubscribeKey()
protected
validateSubscribeKey() : mixed
Tags
addPatterns()
private
addPatterns(mixed $type, mixed $res) : mixed
Parameters
- $type : mixed
- $res : mixed
addResources()
private
addResources(mixed $type, mixed $res) : mixed
Parameters
- $type : mixed
- $res : mixed
createStatus()
private
createStatus(int $category, mixed $response, ResponseInfo|null $responseInfo, PubNubException|null $exception) : PNStatus
Parameters
- $category : int
- $response : mixed
- $responseInfo : ResponseInfo|null
- $exception : PubNubException|null
Return values
PNStatusgetDefaultTransport()
private
getDefaultTransport() : Transport
Tags
Return values
TransportparsePermissions()
private
parsePermissions(mixed $permissions) : mixed
Parameters
- $permissions : mixed