Nextcloud Circles API

EventWrapperService extends NCSignature
in package
Uses TNCRequest, TStringTools

Class EventWrapperService

Table of Contents

DATE_HEADER  = 'D, d M Y H:i:s T'
DATE_OBJECT  = 'Y-m-d\\TH:i:s\\Z'
DATE_TTL  = 300
RETRY_ASAP  = 'asap'
RETRY_DAILY  = 'daily'
RETRY_ERROR  = 100
RETRY_HOURLY  = 'hourly'
$RETRIES  : mixed
$configService  : ConfigService
$dateHeader  : mixed
$eventWrapperRequest  : EventWrapperRequest
$federatedEventService  : FederatedEventService
$remoteUpstreamService  : RemoteUpstreamService
$ttl  : int
__construct()  : mixed
EventWrapperService constructor.
clientService()  : IClientService
confirmStatus()  : void
doRequest()  : void
downloadSignatory()  : void
generateKeys()  : mixed
generateRandomSentence()  : string
generateRandomWord()  : string
getDateDiff()  : string
getKeyOrigin()  : string
getOpenSSLAlgo()  : int
humanReadable()  : string
incomingSignedRequest()  : NCSignedRequest
manageWrapper()  : int
retrieveJson()  : array<string|int, mixed>
retrieveSignatory()  : NCSignatory
return Signatory by its Id from cache or from direct request.
retry()  : mixed
setMaxDownloadSize()  : mixed
signOutgoingRequest()  : NCSignedRequest
signString()  : string
updateSignatory()  : void
verifyString()  : mixed
commonPart()  : string
cut()  : string
feedStringWithParams()  : string
isUuid()  : bool
token()  : string
uuid()  : string
Generate uuid: 2b5a7a87-8db1-445f-a17b-405790f91c80
generationClientOptions()  : mixed
getChosenEncryption()  : string
getFailedEvents()  : array<string|int, mixed>
getUsedEncryption()  : string
parseIncomingSignatureHeader()  : void
setIncomingClearSignature()  : void
setIncomingSignatureHeader()  : void
setOutgoingClearSignature()  : void
setOutgoingSignatureHeader()  : void
setOutgoingSignedSignature()  : void
signingOutgoingRequest()  : void
useClient()  : IResponse
verifyIncomingRequestContent()  : void
verifyIncomingRequestSignature()  : mixed
verifyIncomingRequestTime()  : void
verifySignedRequest()  : mixed

Constants

DATE_HEADER

public mixed DATE_HEADER = 'D, d M Y H:i:s T'

DATE_OBJECT

public mixed DATE_OBJECT = 'Y-m-d\\TH:i:s\\Z'

Properties

$RETRIES

public static mixed $RETRIES = ['asap' => [0, 5], 'hourly' => [5, 150], 'daily' => [150, 300]]

$dateHeader

private mixed $dateHeader = self::DATE_HEADER

Methods

clientService()

public clientService() : IClientService
Return values
IClientService

confirmStatus()

public confirmStatus(string $token[, bool $refresh = false ]) : void
Parameters
$token : string
$refresh : bool = false
Return values
void

downloadSignatory()

public downloadSignatory(NCSignatory $signatory[, string $keyId = '' ][, array<string|int, mixed> $params = [] ][, NCRequest|null $request = null ]) : void
Parameters
$signatory : NCSignatory
$keyId : string = ''
$params : array<string|int, mixed> = []
$request : NCRequest|null = null
Tags
throws
SignatoryException
Return values
void

generateKeys()

public generateKeys(NCSignatory $signatory[, string $digest = 'rsa' ][, int $bits = 2048 ][, int $type = OPENSSL_KEYTYPE_RSA ]) : mixed
Parameters
$signatory : NCSignatory
$digest : string = 'rsa'
$bits : int = 2048
$type : int = OPENSSL_KEYTYPE_RSA
Return values
mixed

generateRandomSentence()

public generateRandomSentence([int $words = 5 ]) : string
Parameters
$words : int = 5
Return values
string

generateRandomWord()

public generateRandomWord([int $length = 8 ]) : string
Parameters
$length : int = 8
Return values
string

getDateDiff()

public getDateDiff(int $first, int $second[, bool $short = false ][, array<string|int, mixed> $words = [] ]) : string
Parameters
$first : int
$second : int
$short : bool = false
$words : array<string|int, mixed> = []
Tags
throws
Exception
Return values
string

humanReadable()

public humanReadable(int $bytes) : string
Parameters
$bytes : int
Return values
string

retrieveSignatory()

return Signatory by its Id from cache or from direct request.

public retrieveSignatory(string $keyId[, bool $refresh = false ]) : NCSignatory

Should be overwritten.

Parameters
$keyId : string
$refresh : bool = false
Tags
throws
SignatoryException
Return values
NCSignatory

retry()

public retry(string $retry) : mixed
Parameters
$retry : string
Return values
mixed

setMaxDownloadSize()

public setMaxDownloadSize(int $size) : mixed
Parameters
$size : int
Return values
mixed

updateSignatory()

public updateSignatory(NCSignatory $signatory, array<string|int, mixed> $json[, string $keyId = '' ]) : void
Parameters
$signatory : NCSignatory
$json : array<string|int, mixed>
$keyId : string = ''
Tags
throws
SignatoryException
Return values
void

verifyString()

public verifyString(string $clear, string $signed, string $publicKey[, string $algo = NCSignatory::SHA256 ]) : mixed
Parameters
$clear : string
$signed : string
$publicKey : string
$algo : string = NCSignatory::SHA256
Tags
throws
SignatureException
Return values
mixed

commonPart()

protected commonPart(string $str1, string $str2[, bool $cs = true ]) : string
Parameters
$str1 : string
$str2 : string
$cs : bool = true

case sensitive ?

Return values
string

cut()

protected cut(string $line, int $length) : string
Parameters
$line : string
$length : int
Return values
string

feedStringWithParams()

protected feedStringWithParams(string $line, array<string|int, mixed> $params) : string
Parameters
$line : string
$params : array<string|int, mixed>
Return values
string

isUuid()

protected isUuid(string $uuid) : bool
Parameters
$uuid : string
Return values
bool

token()

protected token([int $length = 15 ]) : string
Parameters
$length : int = 15
Return values
string

uuid()

Generate uuid: 2b5a7a87-8db1-445f-a17b-405790f91c80

protected uuid(int $length) : string
Parameters
$length : int
Return values
string

generationClientOptions()

private generationClientOptions(NCRequest $request) : mixed
Parameters
$request : NCRequest
Return values
mixed

getFailedEvents()

private getFailedEvents(array<string|int, mixed> $retryRange) : array<string|int, mixed>
Parameters
$retryRange : array<string|int, mixed>
Return values
array<string|int, mixed>

useClient()

private useClient(NCRequest $request) : IResponse
Parameters
$request : NCRequest
Tags
throws
Exception
Return values
IResponse

Search results