Skip to content

Commit 9ca1025

Browse files
committed
Add invite feature
1 parent 4e4d9c4 commit 9ca1025

File tree

5 files changed

+24
-17
lines changed

5 files changed

+24
-17
lines changed

docs/Endpoint-Notes.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This page outlines the general usage patterns and organization of the COMS API.
1010
- [Tag](#tag)
1111
- [Versions](#versions)
1212
- [Permission](#permission)
13+
- [Invite URL's](#invite-urls)
1314
- [Sync](#sync)
1415
- [User](#user)
1516

@@ -31,27 +32,31 @@ Object endpoints directly influence and manipulate S3 objects and information in
3132
- Calling in the Delete endpoint on a bucket without versioning is a hard-delete.
3233
- The `GET /object` search and `PATCH /object/{objectId}/public` public toggle require a backing database in order to function.
3334

34-
### Metadata
35+
## Metadata
3536

3637
Metadata operation endpoints directly focus on the manipulation of metadata of S3 Objects. Each endpoint will create a copy of the object with the modified metadata attached.
3738

3839
More details found here: [Metadata and Tags](Metadata-Tag.md)
3940

40-
### Tag
41+
## Tag
4142

4243
Tag operation endpoints directly focus on the manipulation of tags of S3 Objects. Unlike Metadata, Tags can be modified without the need to create new versions of the object.
4344

4445
More details found here: [Metadata and Tags](Metadata-Tag.md)
4546

46-
### Versions
47+
## Versions
4748

4849
Version specific operations focus on listing and discovering versioning information known by COMS. While the majority of version-specific operations are available as query parameters in the Objects endpoints, the `GET /object/{objectId}/version` endpoint focuses on letting users discover and list what versions are available to work with.
4950

50-
## Permission
51+
## Permissions
5152

5253
Permission operation endpoints directly focus on associating users to objects with specific permissions. All of these endpoints require a database to function. Existing permissions can be searched for using `GET /permission/object` and `GET /permission/bucket`, and standard create, read and delete operations for permissions exist to allow users to modify access control for specific objects they have management permissions over.
5354

54-
More details found here: [Permissions](Permissions.md)
55+
## Invite URL's
56+
57+
COMS also offers a user invite feature. Generate a time-limited, single use invitation token which can be used by an authenticated user to acquire `READ` or other permissions to a specific resource (object or bucket). Optional email-user validation may be specified to ensure the link is only used by the intended recipient. To create an invite link one must have the MANAGE permission on the resource being shared.
58+
59+
See [API Specification](https://coms.api.gov.bc.ca/api/v1/docs#tag/Permission/operation/createInvite)
5560

5661
## Sync
5762

docs/Permissions.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This page outlines the general design used for managing User Access Control to S
1010
- [Examples](#examples)
1111
- [Response Scope Expansion](#response-scope-expansion)
1212
- [Mode Considerations](#mode-considerations)
13-
- [Overrides](#overrides)
13+
- [Invite Links](#invite-links)
1414
- [Public](#public)
1515

1616
## Overview
@@ -171,9 +171,11 @@ The above permission system will only be enforced if your instance of COMS is ru
171171

172172
For more specific information on COMS deployment modes and how they differ, please take a look at the COMS [Configuration guide](Configuration#authentication-modes).
173173

174-
## Overrides
174+
## Invite Links
175175

176-
While the COMS DAC model is generally precise about what users are able to do, there are specific escape hatches and situations where the DAC is superceded or ignored by COMS for a different ruleset. This is done because while the DAC is rich and capable of expressing many access control needs, there are situations where the user may not be known in advance, and as such binding a permission to the potential user is not possible.
176+
COMS also offers a user invite feature. Generate a time-limited, single use invitation token which can be used by an authenticated user to acquire `READ` or other permissions to a specific resource (object or bucket). Optional email-user validation may be specified to ensure the link is only used by the intended recipient. To create an invite link one must have the MANAGE permission on the resource being shared.
177+
178+
See [API Specification](https://coms.api.gov.bc.ca/api/v1/docs#tag/Permission/operation/createInvite)
177179

178180
### Public
179181

docs/Synchronization.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ However, as there is no mechanism for S3 to directly notify COMS of any changes,
44

55
To avoid this, COMS can be told to **synchronize** a bucket, where it looks at a S3 bucket it manages and updates the entries in its database, matching what's actually in the bucket.
66

7-
## The synchronization process
7+
## The Synchronization process
88

99
Clients can trigger the sync process through a [set of dedicated API endpoints](https://coms.api.gov.bc.ca/api/v1/docs#tag/Sync).
1010

1111
When these endpoints are called, COMS checks both the S3 bucket and its database for a list of objects in the bucket, merges them into a single list without duplicates, and enqueues each resulting object (or **job**) into a shared queue in the COMS database, before returning the number of objects enqueued.
1212

1313
The actual synchronization is handled by a separate sync service, which polls the database queue for new jobs every 10 seconds. Once a job is picked up, it compares the corresponding object's state in both S3 and COMS; in particular, it looks at whether it exists in either S3 or COMS (that is, whether it's a new or deleted file), as well as its tags and metadata, and updates the database accordingly.
1414

15-
![COMS sync flow](images/coms_sync_flow.png)
15+
![COMS sync flow](images/coms_sync_flow.png)<br />
1616
**Figure 1 - an illustration of the sync process**
1717

18-
### The `queueManager` service
18+
## The `queueManager` service
1919

2020
The actual sync work is performed by the `queueManager` (labeled "Sync service" in the sequence diagram above), which is on a thread separate from the COMS API.
2121

2222
Every 10 seconds, it polls the queue, which is implemented as a database table named `object_queue`. If the queue is empty, it goes back to waiting for another ten seconds.
2323

2424
If the queue is not empty, it grabs a job from it, and performs the sync process on the associated file. Once it completes that process, it checks the queue for another job to process. If the queue is empty, it goes back to waiting for another 10 seconds before polling the queue again.
2525

26-
![queueManager state](images/queue_manager_state.png)
27-
**Figure 2 - an illustration of `queueManager`'s possible states, as it polls the queue and performs sync jobs.**
26+
![queueManager state](images/queue_manager_state.png)<br />
27+
**Figure 2 - an illustration of queueManager's possible states, as it polls the queue and performs sync jobs.**

docs/Use-Case-Examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ The following steps describe how a document management interface in your applica
3030
6. `User B` logs in to the client application.
3131
7. Client application makes request to [Read Object](https://coms.api.gov.bc.ca/api/v1/docs#tag/Object/operation/readObject) endpoint (with User B's JWT in an Authorization header)
3232
- COMS will verify User B using the JWT and look up permissions for the file in the COMS database
33-
- COMS will then respond with a redirect to a pre-signed url to the source object in the storage server or allow direct download via proxy. Read the section on [OIDC AUthentication](Authentication#authentication-flow-for-readobject) for more details.
33+
- COMS will then respond with a redirect to a pre-signed url to the source object in the storage server or allow direct download via proxy. Read the section on [OIDC AUthentication](Authentication.md#authentication-flow-for-readobject) for more details.
3434

3535
For full implementation details of the COMS API, visit the [BCBox](https://github.com/bcgov/bcbox) repository.

docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ Take advantage of more cost-effective storage solutions for your new or existing
66

77
## Onboarding Options
88

9-
COMS is now available as a shared hosted service as well as an application that you can customise and deploy in your own infrastructure. See documentation on [Hosting Considerations](Hosting-Considerations.md).
9+
COMS is now available as a shared hosted service as well as an application that you can customise and deploy in your own infrastructure.<br />
10+
See documentation on [Hosting Considerations](Hosting-Considerations.md).
1011

1112
We have also launched [BCBox](https://bcbox.nrs.gov.bc.ca), a DropBox-like user-interface for managing files, integrated with the hosted COMS service.
1213

@@ -29,8 +30,7 @@ Please follow the links in the side menu to learn more about COMS.
2930
- GitHub Repository: [https://github.com/bcgov/common-object-management-service/](https://github.com/bcgov/common-object-management-service/)
3031
- API Specification: [https://coms.api.gov.bc.ca/api/v1/docs](https://coms.api.gov.bc.ca/api/v1/docs)
3132
- UI Integration: [BCBox](https://bcbox.nrs.gov.bc.ca)
32-
33-
**[Product Roadmap](Product-Roadmap.md)**
33+
- **[Product Roadmap](Product-Roadmap.md)**
3434

3535
***
3636

0 commit comments

Comments
 (0)