Methods
(async, static) createCloudfrontDistribution(serviceId, instanceName, ctx, optsopt)
- Description:
Create a CloudFront distribution for a given instance
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
serviceId |
Service identifier |
||
instanceName |
Instance name |
||
ctx |
Open Source Cloud configuration context |
||
opts |
CdnOpts |
<optional> |
CDN options |
Returns:
CloudFront distribution
(async, static) generateCommonAccessToken(ctx, claims, opts) → {Promise.<string>}
- Description:
Generate a Common Access Token (CTA-5007) using Andersnas Nodecat open webservice
Example
import { Context } from '@osaas/client-core';
import { generateCommonAccessToken } from '@osaas/client-web';
const ctx = new Context();
const token = await generateCommonAccessToken(
ctx,
{
iss: 'eyevinn',
sub: 'jonas'
},
{
signingKey:
'403697de87af64611c1d32a05dab0fe1fcb715a86ab435f1ec99192d79569388'
}
);
console.log(token);
// 2D3RhEOhAQWhBFBha2FtYWlfa2V5X2hzMjU2WB2kAWdleWV2aW5uAmVqb25hcwYaZ9TH9QUaZ9TH9Vgg40JB9G77k5RWOlayUSLDl7oFVnnyb4aHYc1qls148WY
Parameters:
Name | Type | Description |
---|---|---|
ctx |
Context | Eyevinn OSC context |
claims |
Claims | Claims to be included in the token |
opts |
CatOptions | Service options |
Returns:
- The generated token
- Type
- Promise.<string>
(async, static) publish(name, dir, ctx, optsopt)
- Description:
Publish a static website using Eyevinn Open Source Cloud Storage
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
Name of the website |
||
dir |
Directory to publish |
||
ctx |
Open Source Cloud configuration context |
||
opts |
PublishOpts |
<optional> |
Publish options |
Returns:
name and url of the published website
(async, static) validateCommonAccessToken(ctx, token, opts)
- Description:
Validate a Common Access Token (CTA-5007) using Andersnas Nodecat open webservice
Example
import { Context } from '@osaas/client-core';
import { validateCommonAccessToken } from '@osaas/client-web';
const ctx = new Context();
const result = await validateCommonAccessToken(
ctx,
'2D3RhEOhAQWhBFBha2FtYWlfa2V5X2hzMjU2WB2kAWdleWV2aW5uAmVqb25hcwYaZ9TH9QUaZ9TH9Vgg40JB9G77k5RWOlayUSLDl7oFVnnyb4aHYc1qls148WY',
{
signingKey:
'403697de87af64611c1d32a05dab0fe1fcb715a86ab435f1ec99192d79569388'
}
);
console.log(result.status);
console.log(result.payload);
Parameters:
Name | Type | Description |
---|---|---|
ctx |
Context | Eyevinn OSC context |
token |
string | A Common Access Token |
opts |
CatOptions | Service options |
Returns:
- The status and payload of the token