Comments (4)
a use case:
Say a user has directories in their bucket based on date:
- bucketname/202001
- bucketname/202002
- bucketname/202003
- bucketname/...
- bucketname/202008
and they want the latest month to be private, but previous data be public, the bucketmap could be granular enough to have bucketname/202008 as a private bucket.
This of course would require updating the bucketmap periodically, so perhaps there is a better solution
from thin-egress-app.
IDEA:
Allow bucket & Prefix in PUBLIC and PRIVATE bucket blocks:
MAP:
general-browse: browse-bucket
productX: productX
PUBLIC_BUCKETS:
general-browse: "General browse Imagery"
productX/browse: "ProductX Browse Imagery"
PRIVATE_BUCKETS:
productX/2020/12:
- science_team
Where:
- request to
https://<TEA>/productX/<object>
require basic auth - request to
https://<TEA>/productX/browse/<object>
are public - request to
https://<TEA>/productX/2020/12/<object>
require membership in science_team
Line 625 in 811a783
That can be achieved by updating check_public_bucket()
and check_private_bucket()
to accept an optional object_uri
, and updating this basic bucket check to be a little more sophisticated:
Below is a few examples/sanity check of how this would work in code:
def bucket_prefix_match(bucket_check, bucket_map, object=""):
if bucket_check == bucket_map.split('/')[0] and object.startswith("/".join(bucket_map.split('/')[1:])):
print("Matched")
else:
print("Not Matched")
# No Object Specified Bucket Match
bucket_prefix_match(bucket_check='bucket1', \
bucket_map='bucket1')
# Deep match https://<TEA>/bucket1/prefix1/prefix2/path/object
bucket_prefix_match(bucket_check='bucket1', \
bucket_map='bucket1/prefix1/prefix2', \
object='prefix1/prefix2/path/object')
# Shallow Match https://<TEA>/bucket1/prefix1/path/object
bucket_prefix_match(bucket_check='bucket1', \
bucket_map='bucket1/prefix1', \
object='prefix1/path/object')
# Shallow Match, unnecessary trailing slash https://<TEA>/bucket1/prefix1/path/object
bucket_prefix_match(bucket_check='bucket1', \
bucket_map='bucket1/prefix1/', \
object='prefix1/path/object')
# Simple match https://<TEA>/bucket1/object
bucket_prefix_match(bucket_check='bucket1', \
bucket_map='bucket1', \
object='object')
# Bucket Mismatch https://<TEA>/bucket2/prefix1/path/object
bucket_prefix_match(bucket_check='bucket2', \
bucket_map='bucket1/prefix1', \
object='prefix1/path/object')
# Bucket Match, Prefix Mismatch https://<TEA>/bucket1/prefix2/path/object
bucket_prefix_match(bucket_check='bucket1', \
bucket_map='bucket1/prefix1', \
object='prefix2/path/object')
# No Object Specified Bucket Mis-Match
bucket_prefix_match(bucket_check='bucket1', \
bucket_map='bucket2/prefix1/prefix2')
# No Object Specified Prefix mis-Match
bucket_prefix_match(bucket_check='bucket1', \
bucket_map='bucket1/prefix1/prefix2')
from thin-egress-app.
Added to rain-api-code w/ asfadmin/rain-api-core#100
from thin-egress-app.
Released in https://github.com/asfadmin/thin-egress-app/releases/tag/tea-build.102
from thin-egress-app.
Related Issues (20)
- [rain-api-core] Allow multi-level object-prefix configurations HOT 1
- Explore using semantic version ID's instead of the current numerical series. HOT 1
- Increase stack_name past 35 chars HOT 1
- Check for x-forwarded-for Header for user's apparent IP
- thin-egress-app-IamPolicyDownload with AWS SourceIPs is too large in us-east-1 HOT 4
- UpdatePolicyLambda timeouts during CloudFormation stack creation HOT 6
- Record and re-use in-bound `x-origin-request-id` header for traceability across services HOT 2
- Pass `x-request-id` as a request header to outbound requests to ESDIS services HOT 2
- Add json-object logging payloads with specific high-precision timing for ALL external requests HOT 2
- Allow for "null" CORS Origin after CORS redirect HOT 1
- Map Terraform bool to "True/False" string for `UseCorsCookieDomain` HOT 1
- Access to public data in user-group restricted bucket not quite right.
- debug logging of HEAD request "download" object throws error
- Add Makefile target for creating a JWT key pair
- Profile endpoint returns plain text with application/json content type
- WS-2022-0365 (High) detected in cryptography-38.0.1-cp36-abi3-manylinux_2_24_x86_64.whl - autoclosed HOT 1
- CVE-2023-38325 (High) detected in cryptography-41.0.1-cp37-abi3-manylinux_2_28_x86_64.whl - autoclosed HOT 1
- CVE-2023-5752 (Low) detected in pip-23.1.2-py3-none-any.whl - autoclosed HOT 1
- CVE-2023-49083 (Critical) detected in cryptography-41.0.5-cp37-abi3-manylinux_2_28_x86_64.whl - autoclosed HOT 1
- Two sources of truth for TEA version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thin-egress-app.