-
Notifications
You must be signed in to change notification settings - Fork 246
Standard authorization for backbeat routes #5714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
williamlardier
wants to merge
10
commits into
development/8.8
Choose a base branch
from
bugfix/CLDSRV-591
base: development/8.8
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7c88864
Document backbeat routes
williamlardier c0bb428
Ensure backbeat routes are authorizing requests
williamlardier decfc8f
Unify implicit deny handling in normal and backbeat routes
williamlardier 9481e78
Ensure coherence of callback parameters
williamlardier d8cd2e4
Re-enable route backbeat tests
williamlardier a21ea94
Disable ceph tests using AWS as the bucket does not exist anymore
williamlardier 20412bc
Make java test independent from js tests
williamlardier 1e3ad11
Make js test independent from existing buckets
williamlardier 53abbd2
Update documentation
williamlardier 34912f8
Update documentation use cases
williamlardier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
# Backbeat routes | ||
|
||
Backbeat routes are implemented in `lib/routes/routeBackbeat.js`. | ||
|
||
This special router is responsible for handling all the requests that are | ||
related to the Backbeat service. Backbeat may call any of the below APIs to | ||
perform operations on either data or s3 objects (metadata). | ||
|
||
These routes follow the same authorization and validation as the S3 routes: | ||
|
||
- Authorize the request with support for Implicit Denies from the IAM service. | ||
- Retrieve the bucket and object metadata if applicable. | ||
- Evaluate the S3 Bucket Policies and ACLs before authorizing the request. | ||
- Backbeat routes are only authorized given the right permission, currently, | ||
`objectReplicate` as a unique permission for all these special routes. | ||
- In order to be authorized without S3 Bucket Policy, the caller must be | ||
authorized by the IAM service and the ACLs. Service accounts and accounts | ||
are allowed. | ||
- Finally, evaluate the quotas before allowing the request to proceed. | ||
|
||
## List of supported APIs | ||
|
||
```plaintext | ||
PUT /_/backbeat/metadata/<bucket name>/<object key> | ||
``` | ||
|
||
To edit one existing S3 Object's metadata. | ||
In the CRR case, this is used to put metadata for new objects. | ||
|
||
```plaintext | ||
GET /_/backbeat/metadata/<bucket name>/<object key>?versionId=<version id> | ||
``` | ||
|
||
To get one existing S3 Object's metadata. Version id can be specified to get | ||
the metadata of a specific version. | ||
|
||
```plaintext | ||
PUT /_/backbeat/data/<bucket name>/<object key> | ||
``` | ||
|
||
To put directly to the storage layer the data for an existing S3 Object. | ||
|
||
```plaintext | ||
PUT /_/backbeat/multiplebackenddata/<bucket name>/<object key>?operation=putobject | ||
``` | ||
|
||
To put directly to the storage layer the data for an existing S3 Object. | ||
Use case: Cross Region Replication (CRR). | ||
williamlardier marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```plaintext | ||
PUT /_/backbeat/multiplebackenddata/<bucket name>/<object key>?operation=putpart | ||
``` | ||
|
||
To put directly to the storage layer the data for an existing S3 Object part. | ||
Use case: Cross Region Replication (CRR). | ||
|
||
```plaintext | ||
DELETE /_/backbeat/multiplebackenddata/<bucket name>/<object key>?operation=deleteobject | ||
``` | ||
|
||
To delete the data for an existing S3 Object. | ||
Use case: Cross Region Replication (CRR). | ||
|
||
```plaintext | ||
DELETE /_/backbeat/multiplebackenddata/<bucket name>/<object key>?operation=abortmpu | ||
``` | ||
|
||
To abort a multipart upload. | ||
Use case: Cross Region Replication (CRR). | ||
|
||
```plaintext | ||
DELETE /_/backbeat/multiplebackenddata/<bucket name>/<object key>?operation=deleteobjecttagging | ||
``` | ||
|
||
To delete the tagging for an existing S3 Object. | ||
Use case: Cross Region Replication (CRR). | ||
|
||
```plaintext | ||
POST /_/backbeat/multiplebackenddata/<bucket name>/<object key>?operation=initiatempu | ||
``` | ||
|
||
To initiate a multipart upload. | ||
Use case: Cross Region Replication (CRR). | ||
|
||
```plaintext | ||
POST /_/backbeat/multiplebackenddata/<bucket name>/<object key>?operation=completempu | ||
``` | ||
|
||
To complete a multipart upload. | ||
Use case: Cross Region Replication (CRR). | ||
|
||
```plaintext | ||
POST /_/backbeat/multiplebackenddata/<bucket name>/<object key>?operation=puttagging | ||
``` | ||
|
||
To put the tagging for an existing S3 Object. | ||
Use case: Cross Region Replication (CRR). | ||
|
||
```plaintext | ||
GET /_/backbeat/multiplebackendmetadata/<bucket name>/<object key> | ||
``` | ||
|
||
To get the metadata for an existing S3 Object. Similar to a S3 HeadObject. | ||
Use case: Cross Region Replication (CRR). | ||
|
||
```plaintext | ||
POST /_/backbeat/batchdelete | ||
``` | ||
|
||
Delete a batch of objects froem the storage layer. | ||
Use case: restored S3 Object expiration. | ||
|
||
```plaintext | ||
GET /_/backbeat/lifecycle/<bucket name>?list-type=current | ||
``` | ||
|
||
To list current S3 Object versions from an S3 Bucket. | ||
Use case: lifecycle listings. | ||
|
||
```plaintext | ||
GET /_/backbeat/lifecycle/<bucket name>?list-type=noncurrent | ||
``` | ||
|
||
To list noncurrent S3 Object versions from an S3 Bucket. | ||
Use case: lifecycle listings. | ||
|
||
```plaintext | ||
GET /_/backbeat/lifecycle/<bucket name>?list-type=orphan | ||
``` | ||
|
||
To list delete markers from an S3 Bucket. | ||
Use case: lifecycle listings. | ||
|
||
```plaintext | ||
POST /_/backbeat/index/<bucket name>?operation=add | ||
``` | ||
|
||
To create an index for a bucket. | ||
Use case: MongoDB backend. | ||
|
||
```plaintext | ||
POST /_/backbeat/index/<bucket name>?operation=delete | ||
``` | ||
|
||
To delete an index for a bucket. | ||
Use case: MongoDB backend. | ||
|
||
```plaintext | ||
GET /_/backbeat/index/<bucket name> | ||
``` | ||
|
||
To get the index for a bucket. | ||
Use case: MongoDB backend. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.