@abgov/adsp-sdk-mcp-server 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -0
- package/assets/docs/architecture.md +79 -0
- package/assets/docs/getting-started.md +118 -0
- package/assets/docs/important-notes.md +47 -0
- package/assets/docs/index.md +9 -0
- package/assets/docs/platform/deployment.md +80 -0
- package/assets/docs/platform/getting-started.md +66 -0
- package/assets/docs/platform/operations.md +8 -0
- package/assets/docs/platform/platform-django-sdk.md +330 -0
- package/assets/docs/platform/platform-dotnet-sdk.md +457 -0
- package/assets/docs/platform/platform-flask-sdk.md +355 -0
- package/assets/docs/platform/platform-node-sdk.md +433 -0
- package/assets/docs/platform/platform-spring-sdk.md +344 -0
- package/assets/docs/platform/platform.md +8 -0
- package/assets/docs/services/access-service.md +75 -0
- package/assets/docs/services/agent-service.md +316 -0
- package/assets/docs/services/cache-service.md +61 -0
- package/assets/docs/services/calendar-service.md +86 -0
- package/assets/docs/services/comment-service.md +87 -0
- package/assets/docs/services/configuration-service.md +92 -0
- package/assets/docs/services/directory-service.md +57 -0
- package/assets/docs/services/event-service.md +122 -0
- package/assets/docs/services/feedback-service.md +152 -0
- package/assets/docs/services/file-service.md +164 -0
- package/assets/docs/services/form-service.md +149 -0
- package/assets/docs/services/notification-service.md +151 -0
- package/assets/docs/services/pdf-service.md +116 -0
- package/assets/docs/services/pii-service.md +45 -0
- package/assets/docs/services/push-service.md +106 -0
- package/assets/docs/services/services.md +6 -0
- package/assets/docs/services/status-service.md +29 -0
- package/assets/docs/services/task-service.md +139 -0
- package/assets/docs/services/tenant-service.md +18 -0
- package/assets/docs/services/token-handler.md +135 -0
- package/assets/docs/services/value-service.md +80 -0
- package/assets/docs/services/verify-service.md +61 -0
- package/assets/docs/tutorials/access-service/access-service.md +9 -0
- package/assets/docs/tutorials/access-service/adsp-clients.md +29 -0
- package/assets/docs/tutorials/access-service/application-clients.md +61 -0
- package/assets/docs/tutorials/access-service/front-end-access.md +53 -0
- package/assets/docs/tutorials/access-service/introduction.md +33 -0
- package/assets/docs/tutorials/access-service/tenants.md +68 -0
- package/assets/docs/tutorials/access-service/themes.md +43 -0
- package/assets/docs/tutorials/feedback-service/accessing-data.md +41 -0
- package/assets/docs/tutorials/feedback-service/feedback-service.md +9 -0
- package/assets/docs/tutorials/feedback-service/installation.md +142 -0
- package/assets/docs/tutorials/feedback-service/introduction.md +28 -0
- package/assets/docs/tutorials/feedback-service/security.md +40 -0
- package/assets/docs/tutorials/feedback-service/triggering.md +21 -0
- package/assets/docs/tutorials/file-service/file-service.md +9 -0
- package/assets/docs/tutorials/file-service/file-types.md +35 -0
- package/assets/docs/tutorials/file-service/introduction.md +34 -0
- package/assets/docs/tutorials/file-service/security.md +31 -0
- package/assets/docs/tutorials/file-service/working-with.md +65 -0
- package/assets/docs/tutorials/form-service/Integration.md +31 -0
- package/assets/docs/tutorials/form-service/ai-agent.md +450 -0
- package/assets/docs/tutorials/form-service/building-forms.md +264 -0
- package/assets/docs/tutorials/form-service/cheat-sheet.md +1461 -0
- package/assets/docs/tutorials/form-service/custom-error-messages.md +87 -0
- package/assets/docs/tutorials/form-service/data-registers.md +204 -0
- package/assets/docs/tutorials/form-service/file-uploader.md +81 -0
- package/assets/docs/tutorials/form-service/form-app.md +72 -0
- package/assets/docs/tutorials/form-service/form-editor.md +62 -0
- package/assets/docs/tutorials/form-service/form-service.md +9 -0
- package/assets/docs/tutorials/form-service/form-submissions.md +77 -0
- package/assets/docs/tutorials/form-service/instructions.md +173 -0
- package/assets/docs/tutorials/form-service/introduction.md +66 -0
- package/assets/docs/tutorials/form-service/repeated-items.md +87 -0
- package/assets/docs/tutorials/form-service/security.md +36 -0
- package/assets/docs/tutorials/form-service/steppers.md +237 -0
- package/assets/docs/tutorials/notification-service/emailAttachment.md +75 -0
- package/assets/docs/tutorials/notification-service/events.md +20 -0
- package/assets/docs/tutorials/notification-service/introduction.md +37 -0
- package/assets/docs/tutorials/notification-service/notification-service.md +9 -0
- package/assets/docs/tutorials/notification-service/notification-types.md +86 -0
- package/assets/docs/tutorials/notification-service/subscribers.md +33 -0
- package/assets/docs/tutorials/pdf-service/building-a-template.md +339 -0
- package/assets/docs/tutorials/pdf-service/generate-a-pdf.md +150 -0
- package/assets/docs/tutorials/pdf-service/handlebars.md +51 -0
- package/assets/docs/tutorials/pdf-service/introduction.md +26 -0
- package/assets/docs/tutorials/pdf-service/pdf-service.md +9 -0
- package/assets/docs/tutorials/pdf-service/puppeteer.md +25 -0
- package/assets/docs/tutorials/pdf-service/video.md +18 -0
- package/assets/docs/tutorials/status-service/Introduction.md +46 -0
- package/assets/docs/tutorials/status-service/health.md +51 -0
- package/assets/docs/tutorials/status-service/notices.md +34 -0
- package/assets/docs/tutorials/status-service/notifications.md +107 -0
- package/assets/docs/tutorials/status-service/status-service.md +9 -0
- package/assets/docs/tutorials/status-service/status.md +35 -0
- package/assets/docs/tutorials/status-service/webhooks.md +24 -0
- package/assets/docs/tutorials/task-service/introduction.md +23 -0
- package/assets/docs/tutorials/task-service/task-app.md +43 -0
- package/assets/docs/tutorials/task-service/task-definitions.md +49 -0
- package/assets/docs/tutorials/task-service/task-queues.md +67 -0
- package/assets/docs/tutorials/task-service/task-service.md +9 -0
- package/assets/docs/tutorials/tutorials.md +8 -0
- package/package.json +18 -0
- package/src/docs/docsRepository.d.ts +22 -0
- package/src/docs/docsRepository.js +110 -0
- package/src/docs/docsRepository.js.map +1 -0
- package/src/main.d.ts +2 -0
- package/src/main.js +16 -0
- package/src/main.js.map +1 -0
- package/src/sdk-reference/reference.d.ts +17 -0
- package/src/sdk-reference/reference.js +547 -0
- package/src/sdk-reference/reference.js.map +1 -0
- package/src/sdk-reference/search.d.ts +6 -0
- package/src/sdk-reference/search.js +41 -0
- package/src/sdk-reference/search.js.map +1 -0
- package/src/server.d.ts +6 -0
- package/src/server.js +30 -0
- package/src/server.js.map +1 -0
- package/src/tools/registerDocsTools.d.ts +3 -0
- package/src/tools/registerDocsTools.js +66 -0
- package/src/tools/registerDocsTools.js.map +1 -0
- package/src/tools/registerQuickstartTool.d.ts +2 -0
- package/src/tools/registerQuickstartTool.js +82 -0
- package/src/tools/registerQuickstartTool.js.map +1 -0
- package/src/tools/registerSdkTools.d.ts +2 -0
- package/src/tools/registerSdkTools.js +43 -0
- package/src/tools/registerSdkTools.js.map +1 -0
- package/src/tools/types.d.ts +12 -0
- package/src/tools/types.js +3 -0
- package/src/tools/types.js.map +1 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Installation
|
|
3
|
+
layout: page
|
|
4
|
+
nav_order: 2
|
|
5
|
+
parent: Feedback Service
|
|
6
|
+
grand_parent: Tutorials
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
The feedback service gives you a simple means to collect information from end-users about their experience when your site. When integrated into your application the service will:
|
|
12
|
+
|
|
13
|
+
- Add a call-to-action to the application that, when clicked, pops up a modal with a couple of questions for the end-user to fill in.
|
|
14
|
+
- Save the information collected in an ADSP database.
|
|
15
|
+
|
|
16
|
+
<p align='center' with='100%'>
|
|
17
|
+
<img src='/adsp-monorepo/assets/feedback-service/feedbackWidget.png' width='400px'/>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
## Application Integration {#target-integration}
|
|
21
|
+
|
|
22
|
+
To install the service you only need to add a couple of lines of code to your application. First, you must include some javascript inside the head to load the widget:
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<head>
|
|
26
|
+
...
|
|
27
|
+
<script src="https://feedback-service.adsp-uat.alberta.ca/feedback/v1/script/adspFeedback.js"></script>
|
|
28
|
+
</head>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The script creates a global variable called _adspFeedback_. Then, somewhere inside the body you would initialize the code:
|
|
32
|
+
|
|
33
|
+
```html
|
|
34
|
+
<body>
|
|
35
|
+
...
|
|
36
|
+
<script>
|
|
37
|
+
adspFeedback.initialize();
|
|
38
|
+
</script>
|
|
39
|
+
</body>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
There are configuration parameters you will want to add to the initialization method, but essentially that's it. The script will attach the _call-to-action_ to right hand side of the page which, when clicked, will pop up the feedback modal:
|
|
43
|
+
|
|
44
|
+
<p align='center' with='100%'>
|
|
45
|
+
<img src='/adsp-monorepo/assets/feedback-service/call-to-action.png' width='300px'/>
|
|
46
|
+
</p>
|
|
47
|
+
|
|
48
|
+
## Configuration
|
|
49
|
+
|
|
50
|
+
There are a few ways you can configure the feedback service to tailor it to your needs, including
|
|
51
|
+
|
|
52
|
+
- tenant identification
|
|
53
|
+
- source identification
|
|
54
|
+
- allowing anonymous users
|
|
55
|
+
- associating feedback with another entity, such as an end-user
|
|
56
|
+
|
|
57
|
+
### Tenant Identification
|
|
58
|
+
|
|
59
|
+
As part of ADSP, feedback records are associated with a _tenant_, and there is no crossover. That is, when you access feedback records you will only be able to get those associated with your tenant. To that end it is important when you are initializing your widget that you identify it. The means of identification might be different depending on whether or not your application is allowing anonymous access to the widget.
|
|
60
|
+
|
|
61
|
+
For many applications feedback will be coming from logged in users. In order for the widget to work properly it will need the user's valid keycloak access token. Since valid tokens only last for a few minutes you'll need to pass in a function that can be used by the widget to obtain the token, so your initialization might look like this:
|
|
62
|
+
|
|
63
|
+
```html
|
|
64
|
+
<body>
|
|
65
|
+
...
|
|
66
|
+
<script>
|
|
67
|
+
adspFeedback.initialize({getAccessToken: () => {<your getter method>}});
|
|
68
|
+
</script>
|
|
69
|
+
</body>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The tenant name will be extracted from the access token, and the feedback information will then be associated with it.
|
|
73
|
+
|
|
74
|
+
Note: The service itself does not make a record of the user ID in the access token. If this is desired you can use the [correlation ID](#target-correlationid) for this purpose.
|
|
75
|
+
|
|
76
|
+
#### Anonymous access
|
|
77
|
+
|
|
78
|
+
For anonymous access you must submit your tenant name directly, as follows:
|
|
79
|
+
|
|
80
|
+
```html
|
|
81
|
+
<body>
|
|
82
|
+
...
|
|
83
|
+
<script>
|
|
84
|
+
adspFeedback.initialize({tenant: <your tenant name>});
|
|
85
|
+
</script>
|
|
86
|
+
</body>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
In the special case where you have a multi-tenant application you can set the tenant as a query parameter in the application url, e.g. https://my-app.alberta.ca/start-page?tenant=\<your tenant\>.
|
|
90
|
+
|
|
91
|
+
In addition though, for security purposes, you must explicitly configure your site to allow anonymous access. This can be done when you [register your site](#target-registered-usage).
|
|
92
|
+
|
|
93
|
+
<p align='center' with='100%'>
|
|
94
|
+
<img src='/adsp-monorepo/assets/feedback-service/allowAnonymousFeedback.png' width='300px'/>
|
|
95
|
+
</p>
|
|
96
|
+
|
|
97
|
+
### Source Identification
|
|
98
|
+
|
|
99
|
+
Of course, feedback it not all that useful unless you can identify where it came from. To this end some _context_ is saved along the the feedback, including:
|
|
100
|
+
|
|
101
|
+
- [the site](#target-site)
|
|
102
|
+
- [the view](#target-view),
|
|
103
|
+
- [a _correlationId_](#target-correlationid), and
|
|
104
|
+
- the time of submission.
|
|
105
|
+
|
|
106
|
+
For the most part the widget defines reasonable defaults for the context, but if required you can configure it as follows:
|
|
107
|
+
|
|
108
|
+
```javascript
|
|
109
|
+
const getContext = function () {
|
|
110
|
+
return Promise.resolve({ site: <your site>, view: <your view>, correlationId:<any id> });
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
adspFeedback.initialize({getAccessToken: <your function>, getContext: getContext})
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Note: _getContext_ and its parameters are optional so unless you want to override the _site_, _view_ or _correlationId_ you can ignore it.
|
|
117
|
+
|
|
118
|
+
#### Site {#target-site}
|
|
119
|
+
|
|
120
|
+
The site defaults to:
|
|
121
|
+
|
|
122
|
+
```javascript
|
|
123
|
+
`${document.location.protocol}//${document.location.host}`;
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
#### View {#target-view}
|
|
127
|
+
|
|
128
|
+
The view defaults to:
|
|
129
|
+
|
|
130
|
+
```javascript
|
|
131
|
+
document.location.pathname;
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
#### Correlation ID {#target-correlationid}
|
|
135
|
+
|
|
136
|
+
The correlation ID is an optional string parameter that applications can use to correlate the feedback with another entity. For example, if your application requires users to log in you could _use a hash_ of their user id to determine if a user has submitted feedback more than once. Note: It is **important** that a user id is not used directly in the correlation ID, as it would be a violation of privacy.
|
|
137
|
+
|
|
138
|
+
The correlationId defaults to:
|
|
139
|
+
|
|
140
|
+
```javascript
|
|
141
|
+
`${site}:${view}`;
|
|
142
|
+
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Introduction
|
|
3
|
+
layout: page
|
|
4
|
+
nav_order: 1
|
|
5
|
+
parent: Feedback Service
|
|
6
|
+
grand_parent: Tutorials
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Introduction
|
|
10
|
+
|
|
11
|
+
The feedback service gives you a simple means to collect information from end-users about their experience when your site. When integrated into your application the service will:
|
|
12
|
+
|
|
13
|
+
- Add a call-to-action to the application that, when clicked, pops up a modal with a couple of questions for the end-user to fill in.
|
|
14
|
+
- Save the information collected in an ADSP database.
|
|
15
|
+
|
|
16
|
+
<p align='center' with='100%'>
|
|
17
|
+
<img src='/adsp-monorepo/assets/feedback-service/feedbackWidget.png' width='400px'/>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
## Learn More
|
|
21
|
+
|
|
22
|
+
- Learn how to [integrate the service](/adsp-monorepo/tutorials/feedback-service/installation.html) into your application.
|
|
23
|
+
|
|
24
|
+
- Learn how to build [custom triggers](/adsp-monorepo/tutorials/feedback-service/triggering.html) for the feedback widget.
|
|
25
|
+
|
|
26
|
+
- Learn how the service keeps your data [safe and secure](/adsp-monorepo/tutorials/feedback-service/security.html).
|
|
27
|
+
|
|
28
|
+
- Learn how to [access the feedback](/adsp-monorepo/tutorials/feedback-service/accessing-data.html) submitted for your application.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Security
|
|
3
|
+
layout: page
|
|
4
|
+
nav_order: 3
|
|
5
|
+
parent: Feedback Service
|
|
6
|
+
grand_parent: Tutorials
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Security
|
|
10
|
+
|
|
11
|
+
There are several ways ADSP has addressed security concerns regarding use of the feedback widget. These include:
|
|
12
|
+
|
|
13
|
+
- A mandatory site registration for sites using the service,
|
|
14
|
+
- Sub-resource integrity,
|
|
15
|
+
- DNS attacks,
|
|
16
|
+
- Privacy protection
|
|
17
|
+
|
|
18
|
+
### Registered usage {#target-registered-usage}
|
|
19
|
+
|
|
20
|
+
As the widget is implemented in javascript and accessible through the browser it would be easy enough for anyone to try to use it for their own nefarious purposes, such as spam or DNS attacks. For this reason the service will only work with registered sites. To register your site, login to the ADSP website, select the feedback service, then the _Sites_ tab, and click the _Register site_ button.
|
|
21
|
+
|
|
22
|
+
<p align='center' with='100%'>
|
|
23
|
+
<img src='/adsp-monorepo/assets/feedback-service/registerSite.png' width='300px'/>
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
### Sub-resource Integrity (SRI)
|
|
27
|
+
|
|
28
|
+
Sub-resource integrity is a technique you can use to verify that the javascript resource fetched by you application has not been manipulated. The technique is described in detail [here](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity). You can obtain an encoded integrity string by calling an endpoint for this purpose, i.e.
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
GET /feedback/v1/script/integrity
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### DNS attacks
|
|
35
|
+
|
|
36
|
+
The intent of the service is to put some protection in to mitigate the risk of DNS attacks. For now there is a simple strategy of removing the call-to-action once a user submits their feedback.
|
|
37
|
+
|
|
38
|
+
### Privacy protection
|
|
39
|
+
|
|
40
|
+
End users should not enter any information in their feedback that could be used to identify them (PII), in accordance with Alberta's Personal Information Protection Act (PIPA), but not all Albertan's are familiar with it. To ensure that no such information is saved along with the rest of the feedback all comments are run through a redaction algorithm to remove it.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Triggering Feedback
|
|
3
|
+
layout: page
|
|
4
|
+
nav_order: 5
|
|
5
|
+
parent: Feedback Service
|
|
6
|
+
grand_parent: Tutorials
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Default trigger
|
|
10
|
+
|
|
11
|
+
Normally you don't have to do anything to have the feedback service triggered. The initialization process (_adspFeedback.initialize()_) installs a _call-to-action_ tab on a page which, when clicked, will bring up the feedback modal. However, some applications require more control over when and where the modal gets opened. For example, a small, simple application may want the feedback widget opened as soon as the end-user clicks on a _submit_ button, to help encourage feedback submissions.
|
|
12
|
+
|
|
13
|
+
## Application triggers
|
|
14
|
+
|
|
15
|
+
Creating your own trigger is easy enough. Both the _call-to-action_ tab and a site's _Microsite header_ use a simple function call that is exposed in the code for the feedback widget. You simply have to call
|
|
16
|
+
|
|
17
|
+
```javascript
|
|
18
|
+
adspFeedback.openFeedbackForm();
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
as part of an event handler that gets invoked through the desired user action.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: File Type collections
|
|
3
|
+
layout: page
|
|
4
|
+
nav_order: 3
|
|
5
|
+
parent: File Service
|
|
6
|
+
grand_parent: Tutorials
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## File Type collections
|
|
10
|
+
|
|
11
|
+
A **File type** is a _named collection_ of files. You can assign certain file-properties to a collection, such as access permissions, and when files are added to it they will inherit them. So, for example, you can create a new file type named _public_, and assign it a _read-only_ file-property. Any files added to the _public_ collection will then be immutable, but accessible to anyone.
|
|
12
|
+
|
|
13
|
+
This gives developers a means for organizing and managing files with shared properties. You would want to create a File Type collection to
|
|
14
|
+
|
|
15
|
+
- group all files associated with an application or application feature together
|
|
16
|
+
- group all files associated with an end-user together
|
|
17
|
+
- protect sensitive information from unauthorized access
|
|
18
|
+
- grant public, read-only access to files
|
|
19
|
+
- set the retention policy for files within the collection.
|
|
20
|
+
|
|
21
|
+
### Access Permission
|
|
22
|
+
|
|
23
|
+
Using the ADSP [File Type Editor](https://adsp.alberta.ca) you can create new File Type collections and assign them file-properties. These include access permissions and retention policy. For access permission, the editor presents a set of **Keycloak** roles that have been set up for your tenant, plus a set of roles for ADSP Platform Services that may need to access the files, such as the [PDF Service](/adsp-monorepo/tutorials/pdf-service/introduction.html).
|
|
24
|
+
|
|
25
|
+

|
|
26
|
+
|
|
27
|
+
When you give read or write access to a role, only users or applications with that role can access the files in the collection.
|
|
28
|
+
|
|
29
|
+
There is also an option to grant public read-only permission for any file added to the collection.
|
|
30
|
+
|
|
31
|
+
### Retention Policy
|
|
32
|
+
|
|
33
|
+
Note: Retention Policy is still under development.
|
|
34
|
+
|
|
35
|
+
The _File Service_ gives you much more fine grained control through our [File Type collections](/adsp-monorepo/tutorials/file-service/file-types.html). You can set the retention policy for files in the collection, and those that have lived longer than the retention period will be automatically deleted.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Introduction
|
|
3
|
+
layout: page
|
|
4
|
+
nav_order: 1
|
|
5
|
+
parent: File Service
|
|
6
|
+
grand_parent: Tutorials
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Introduction
|
|
10
|
+
|
|
11
|
+
ADSP's _File Service_ is one that you can use for storing and managing file-based data. From uploading end-user documentation to storing content for presentation, the service gives you massively scalable, secure, storage for your data. Based on Microsoft's [Azure Blob Storage](https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blobs-introduction) and, coupled with our [File Type collections](/adsp-monorepo/tutorials/file-service/file-types.html), the file service gives you full control over who has access to your data, and who doesn't.
|
|
12
|
+
|
|
13
|
+
The service provides APIs that allow you to:
|
|
14
|
+
|
|
15
|
+
- Upload files to Azure Blob cloud Storage,
|
|
16
|
+
- Scan files for viruses and other malware,
|
|
17
|
+
- Grant file access permissions,
|
|
18
|
+
- Associate meta-data with a file, such as its unique ID, who uploaded it, whether or not it was infected, etc., and
|
|
19
|
+
- Search for files.
|
|
20
|
+
|
|
21
|
+
Azure Blob Storage itself is designed for
|
|
22
|
+
|
|
23
|
+
- Serving images or documents directly to a browser,
|
|
24
|
+
- Storing files for distributed access,
|
|
25
|
+
- Streaming video and audio,
|
|
26
|
+
- Writing to log files.
|
|
27
|
+
|
|
28
|
+
so when coupled with the _File Service_ applications can be sure their data both accessible and secure.
|
|
29
|
+
|
|
30
|
+
#### Learn More
|
|
31
|
+
|
|
32
|
+
- Important information about [Security](/adsp-monorepo/tutorials/file-service/security.html)
|
|
33
|
+
- What is a [File Type collections](/adsp-monorepo/tutorials/file-service/file-types.html) collection?
|
|
34
|
+
- Working with [the File Service](/adsp-monorepo/tutorials/file-service/working-with.html)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Security
|
|
3
|
+
layout: page
|
|
4
|
+
nav_order: 3
|
|
5
|
+
parent: File Service
|
|
6
|
+
grand_parent: Tutorials
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Security
|
|
10
|
+
|
|
11
|
+
On its own, Azure Blob Storage is a cloud-based, facility that keeps your data as secure as you want it to be. On top of that, the File Service has its own security features to help applications dictate who has access to files, and who does not.
|
|
12
|
+
|
|
13
|
+
#### Access
|
|
14
|
+
|
|
15
|
+
Azure organizes files [hierarchically](https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blobs-introduction) by account, container, and then files. The File Service uses one account, which has one container for each tenant using the service. When calling File Service APIs, you must [authorize](/adsp-monorepo/tutorials/access-service/introduction.html) them with _Keycloak_ authorization tokens, which contain your tenant ID. Organizing files this way ensures each tenant has access to their files, and only their files.
|
|
16
|
+
|
|
17
|
+
Only _File Service_ has direct access to the files stored in Azure Blob. Applications can only get access to them via the APIs. However, the APIs support role based access through [File Type collections](/adsp-monorepo/tutorials/file-service/file-types.html). You can create collections, assign Tenant roles to them, and then add files to the collection when they are uploaded. The file inherits the access permissions of the collection. This gives developers fine-grained control over which applications and users have read or write access to the files.
|
|
18
|
+
|
|
19
|
+
### Durability
|
|
20
|
+
|
|
21
|
+
Multiple copies of your files are stored by Azure Blob Storage in order to assure high durability. For the curious, we use [RA-GRS redundancy](https://learn.microsoft.com/en-us/azure/storage/common/storage-redundancy#geo-redundant-storage) which gives you 99.(13)9% (13 9's) durability. It achieves this by storing 3 copies of the data in a single location (on separate servers) and 1 copy at a geographically separate location.
|
|
22
|
+
|
|
23
|
+
### Encryption
|
|
24
|
+
|
|
25
|
+
All data stored in Azure Blob is [encrypted](https://learn.microsoft.com/en-us/azure/storage/common/storage-service-encryption?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&bc=%2Fazure%2Fstorage%2Fblobs%2Fbreadcrumb%2Ftoc.json) using 256 bit AES encryption.
|
|
26
|
+
|
|
27
|
+
### Retention
|
|
28
|
+
|
|
29
|
+
The _File Service_ gives you fine grained control of file retention through our [File Type collections](/adsp-monorepo/tutorials/file-service/file-types.html). You can set the retention policy for files in the collection, and those that have been untouched for longer than the retention period will be automatically deleted.
|
|
30
|
+
|
|
31
|
+
Note: this policy does support any specific retention policies for _deleted files_ that may be required for your application. i.e. Once a file has been deleted from the File Service the data will be lost after a 7 day retention period that is set in the _Azure Blob_ configuration. You can, however, define the required retention period in your _File Type collection_ and let the _File Service_ mange the lifecycle. The file will only be deleted once it has been untouched for the defined period of time.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Working with Files
|
|
3
|
+
layout: page
|
|
4
|
+
nav_order: 4
|
|
5
|
+
parent: File Service
|
|
6
|
+
grand_parent: Tutorials
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Working With Files
|
|
10
|
+
|
|
11
|
+
The _File Service_ has two main components;
|
|
12
|
+
|
|
13
|
+
- APIs, with which your application can mange files, and
|
|
14
|
+
- the Tenant Admin Webapp, which lets you configure the service to meet your needs.
|
|
15
|
+
|
|
16
|
+
### Tenant Admin Webapp
|
|
17
|
+
|
|
18
|
+
Configuring the _File Service_ is about creating _File Type collections_, and setting up permissions and retention policies for them. You do this through our [Tenant Admin Webapp](https://adsp-uat.alberta.ca). See [File Type collections](/adsp-monorepo/tutorials/access-service/file-types.html) for more information.
|
|
19
|
+
|
|
20
|
+
### API
|
|
21
|
+
|
|
22
|
+
You can learn the specific details of how an API works from our [Swagger Documentation](https://api.adsp.alberta.ca/autotest/?urls.primaryName=File%20service); here we'll just give a brief overview of the functionality supplied through them.
|
|
23
|
+
|
|
24
|
+
All API calls to the _File Service_ require authentication via Keycloak. See the instructions for [setting up a tenant and getting access tokens](/adsp-monorepo/tutorials/access-service/introduction.html) for details on how to do this.
|
|
25
|
+
|
|
26
|
+
### Uploading
|
|
27
|
+
|
|
28
|
+
Files are uploaded to Azure Blob Storage and stored as octet streams. In addition to the file, there is a small amount of metadata that gets created and stored along with it, as discussed below.
|
|
29
|
+
|
|
30
|
+
### File Scanning
|
|
31
|
+
|
|
32
|
+
When you upload a file, you can specify whether or not it should be scanned for viruses or other malicious software (defaults to scan). Scanning is provided by [ClamAV](https://docs.clamav.net/Introduction.html), an open-source anti-virus toolkit maintained by Cisco Systems Inc. The database is updated frequently, so you can be sure the File Service will be looking for the latest threats. The service is designed to be fast, but you may find there is some delay between uploading and being able to access your file. This should not be an issue with small files.
|
|
33
|
+
|
|
34
|
+
### Access Permission
|
|
35
|
+
|
|
36
|
+
Using File Type collections you can specify access permissions based on your tenant (Keycloak) roles. See ADSP [File Type collections](/adsp-monorepo/tutorials/file-service/file-types.html) for more information.
|
|
37
|
+
|
|
38
|
+
### Metadata
|
|
39
|
+
|
|
40
|
+
Metadata - or File Properties - is stored along with the file. Metadata includes
|
|
41
|
+
|
|
42
|
+
| Name | Description |
|
|
43
|
+
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
44
|
+
| id | The file ID with which which you can refer to the file when performing File Service API calls. |
|
|
45
|
+
| filename | The name of the file. |
|
|
46
|
+
| urn | Logical URN of the file. You can map the URN to a URL using the [ADSP SDK's](https://github.com/GovAlta/adsp-monorepo/blob/main/libs/adsp-service-sdk/src/directory/serviceDirectory.ts) getResourceUrl() method. |
|
|
47
|
+
| size | File Size |
|
|
48
|
+
| typeName | Name of the File Type collection to which the file belongs to. |
|
|
49
|
+
| record ID | An optional, arbitrary, application record-ID that can be used to cross reference the file with application data. |
|
|
50
|
+
| created date | Date the file was uploaded. |
|
|
51
|
+
| created by | The name and ID of the authenticated user that uploaded the file. |
|
|
52
|
+
| scanned | True if the file was scanned when uploaded. |
|
|
53
|
+
| infected | True if a virus or other malware was found in the file contents. |
|
|
54
|
+
|
|
55
|
+
### Searching
|
|
56
|
+
|
|
57
|
+
You can search through your uploaded files using the following criteria
|
|
58
|
+
|
|
59
|
+
- file names matching, or partially matching, an input string
|
|
60
|
+
- metadata matching a specific record ID
|
|
61
|
+
- those files in a specific File Type collection
|
|
62
|
+
|
|
63
|
+
### Downloading
|
|
64
|
+
|
|
65
|
+
Files are stored, and downloaded, as octet streams. Please see the [Swagger Documentation](https://api.adsp.alberta.ca/autotest/?urls.primaryName=File%20service#/File/get_file_v1_files__fileId__download) for more information on downloading via the APIs.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: page
|
|
3
|
+
title: Integration
|
|
4
|
+
parent: Form Service
|
|
5
|
+
grand_parent: Tutorials
|
|
6
|
+
nav_exclude: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Integration
|
|
10
|
+
|
|
11
|
+
Integrating Jsonforms into your application is straight forward. You simply place [their react component](https://jsonforms.io/docs/integrations/react/) where you need it, like this:
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
<JsonForms schema={schema} uischema={uiSchema} data={data} renderers={GoARenderers} onChange={onChange} />
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
where:
|
|
18
|
+
|
|
19
|
+
- The schema and uiSchema are the ones you built in [the Form Editor](/adsp-monorepo/tutorials/form-service/form-editor.html), and can be retrieved with [the Form Service APIs](https://api.adsp-uat.alberta.ca/autotest/?urls.primaryName=Form%20service).
|
|
20
|
+
|
|
21
|
+
- The data is a javascript object conforming to your JSON schema, which will be updated as the user enters information.
|
|
22
|
+
|
|
23
|
+
- The GoARenderers are a library of React components built by ADSP to render the form using the GoA [Design Systems](https://design.alberta.ca/) components. You can install this library via:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
npm install @abgov/jsonforms-components
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- onChange is A callback which is called on each data change, containing the updated data and the validation result.
|
|
30
|
+
|
|
31
|
+
There are several other parameters you can pass into the Jsonforms component to tailor it to you needs, including [custom validation](https://jsonforms.io/docs/validation/) with [AJV](https://github.com/ajv-validator/ajv).
|