ballerina/internal package
Primitives Summary
Type | Description |
---|
Type Definitions
Type | Values | Description |
---|
Annotations
Name | Attachement Points | Data Type | Description |
---|
Objects Summary
Object | Description |
---|---|
CompressionError |
|
IOError |
|
JWTIssuerConfig |
|
JWTValidatorConfig |
|
JwtHeader |
|
JwtPayload |
|
Endpoints Summary
Endpoint | Description |
---|
Functions Summary
Return Type | Function and Description |
---|---|
error | compress(Path dirPath, Path destDir)
|
blob | error | compressToBlob(Path dirPath)
|
boolean | IOError | createDirectory(Path path)
|
boolean | IOError | createFile(Path path)
|
error | decompress(Path dirPath, Path destDir)
|
error | decompressFromBlob(blob content, Path destDir)
|
boolean | IOError | delete(Path path)
|
timeTime | IOError | getModifiedTime(Path path)
|
string | error | issue(JwtHeader header, JwtPayload payload, JWTIssuerConfig config)
|
Path[] | IOError | list(Path path)
|
json | error | parseJson(string s)
|
boolean | pathExists(Path path)
|
JwtPayload | error | validate(string jwtToken, JWTValidatorConfig config)
|
Global Variables
Name | Data Type | Description |
---|
public object CompressionError
Represent all compression related errors.
Field Name | Data Type | Default Value | Description |
---|---|---|---|
message | string | The error message |
|
cause | error | The error which caused the compression error |
public object IOError
Represents an I/O error that could occur when processing a file.
Field Name | Data Type | Default Value | Description |
---|---|---|---|
message | string | ||
cause | error |
public object JWTIssuerConfig
Represents JWT issuer configurations.
Field Name | Data Type | Default Value | Description |
---|---|---|---|
keyAlias | string | ||
keyPassword | string | ||
keyStoreFilePath | string | ||
keyStorePassword | string |
public object JWTValidatorConfig
Represents JWT validator configurations.
Field Name | Data Type | Default Value | Description |
---|---|---|---|
issuer | string | ||
audience | string | ||
clockSkew | int | ||
certificateAlias | string | ||
trustStoreFilePath | string | ||
trustStorePassword | string |
public object JwtHeader
Represents a JWT header.
Field Name | Data Type | Default Value | Description |
---|---|---|---|
alg | string | ||
typ | string | ||
cty | string | ||
kid | string | ||
customClaims | map |
public object JwtPayload
Represents a JWT payload.
Field Name | Data Type | Default Value | Description |
---|---|---|---|
iss | string | ||
sub | string | ||
aud | string[] | ||
jti | string | ||
exp | int | ||
nbf | int | ||
iat | int | ||
customClaims | map |
public function compress(Path dirPath, Path destDir) returns (error)
Compresses a directory.
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
dirPath | Path | Path of the directory to be compressed |
|
destDir | Path | Path of the directory to place the compressed file |
Return Type | Description | ||
---|---|---|---|
error | An error if an error occurs during the compression process |
public function compressToBlob(Path dirPath) returns (blob | error)
Compresses a directory into a blob.
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
dirPath | Path | Path of the directory to be compressed |
Return Type | Description | ||
---|---|---|---|
blob | error | Compressed blob of the file |
public function createDirectory(Path path) returns (boolean | IOError)
Creates a directory in the specified location.
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
path | Path | Reference to the file path location |
Return Type | Description | ||
---|---|---|---|
boolean | IOError | error if the directory could not be created |
public function createFile(Path path) returns (boolean | IOError)
Creates a file in the specified location.
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
path | Path | Reference to the file path location |
Return Type | Description | ||
---|---|---|---|
boolean | IOError | error if the file could not be created |
public function decompress(Path dirPath, Path destDir) returns (error)
Decompresses a compressed file.
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
dirPath | Path | Path of the compressed file |
|
destDir | Path | Path of the directory to decompress the file |
Return Type | Description | ||
---|---|---|---|
error | An error if an error occurs during the decompression process |
public function decompressFromBlob(blob content, Path destDir) returns (error)
Decompresses a blob into a directory.
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
content | blob | Blob of the compressed file |
|
destDir | Path | Path of the directory to decompress the file |
Return Type | Description | ||
---|---|---|---|
error | An error if an error occurs during the decompression process |
public function delete(Path path) returns (boolean | IOError)
Deletes a file/directory from the specified path.
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
path | Path | Reference to the file path location |
Return Type | Description | ||
---|---|---|---|
boolean | IOError | error if the directory/file could not be deleted |
public function getModifiedTime(Path path) returns (timeTime | IOError)
Retrieves the last modified time of the path.
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
path | Path |
Return Type | Description | ||
---|---|---|---|
timeTime | IOError | Last modified time or an error if the path cannot be resolved |
public function issue(JwtHeader header, JwtPayload payload, JWTIssuerConfig config) returns (string | error)
Issue a JWT token.
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
header | JwtHeader | JwtHeader object |
|
payload | JwtPayload | JwtPayload object |
|
config | JWTIssuerConfig | JWTIssuerConfig object |
Return Type | Description | ||
---|---|---|---|
string | error | JWT token string |
public function list(Path path) returns (Path[] | IOError)
Returns the list of paths in the directory.
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
path | Path | Reference to the file path location |
Return Type | Description | ||
---|---|---|---|
Path[] | IOError | List of file paths in the directory or an I/O error |
public function parseJson(string s) returns (json | error)
Parse JSON string to generate JSON object.
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
s | string | JSON string |
Return Type | Description | ||
---|---|---|---|
json | error | JSON object. |
public function pathExists(Path path) returns (boolean)
Check for existance of the file.
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
path | Path | Refernce to the file location |
Return Type | Description | ||
---|---|---|---|
boolean | true if the file exists |
public function validate(string jwtToken, JWTValidatorConfig config) returns (JwtPayload | error)
Validity given JWT token.
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
jwtToken | string | JWT token that need to validate |
|
config | JWTValidatorConfig | JWTValidatorConfig object |
Return Type | Description | ||
---|---|---|---|
JwtPayload | error | If JWT token is valied true , else false |
public type Path object
Reference to the file location.
-
<Path> getPathValue() returns (string)
Retreives the absolute path from the provided location.
Return Type Description string Returns the absolute path string value