Add your description here
Project description
RAJA
This README is intentionally short and focused on day-to-day usage.
For architecture, design notes, tests, and deeper docs, see AGENTS.md.
Target Workflow
- Set env and deploy the stack.
- Use the Admin UI and/or call RALE via
boto3. - Add S3 buckets for testing.
1) Set Env And Deploy
Prereqs:
- AWS credentials configured locally
uv,terraform,docker
uv sync
# one-time (if missing)
cp infra/terraform/terraform.tfvars.example infra/terraform/terraform.tfvars
# required admin key used by protected control-plane endpoints
cat > .env <<'ENV'
RAJA_ADMIN_KEY=change-me-admin-key
RAJA_USERS=ernest-staging,kevin-staging,simon-staging
ENV
./poe deploy
python scripts/show_outputs.py
./poe deploy writes deployment outputs to infra/tf-outputs.json.
2) Run Admin UI
export API_URL="$(python - <<'PY'
import json
print(json.load(open('infra/tf-outputs.json'))['api_url'])
PY
)"
open "$API_URL"
- Browse to
/for the Admin UI. - Enter the same
RAJA_ADMIN_KEYyou used for deploy. - The Token and Enforcement forms default to the first
RAJA_USERSentry from.env.
Quick API check:
curl -sS "$API_URL/principals" \
-H "Authorization: Bearer $RAJA_ADMIN_KEY"
3) Call RALE With boto3
This uses the RAJEE endpoint (which fronts RALE) with normal S3 API calls.
export API_URL="$(python - <<'PY'
import json
o=json.load(open('infra/tf-outputs.json'))
print(o['api_url'])
PY
)"
export RAJEE_ENDPOINT="$(python - <<'PY'
import json
o=json.load(open('infra/tf-outputs.json'))
print(o['rajee_endpoint'])
PY
)"
export TEST_BUCKET="$(python - <<'PY'
import json
o=json.load(open('infra/tf-outputs.json'))
print(o['rajee_test_bucket_name'])
PY
)"
# create a principal with test-bucket permissions
export DEMO_PRINCIPAL="$(python - <<'PY'
import os
import boto3
users = [u.strip() for u in os.environ["RAJA_USERS"].split(",") if u.strip()]
account_id = boto3.client("sts").get_caller_identity()["Account"]
print(f"arn:aws:iam::{account_id}:user/{users[0]}")
PY
)"
curl -sS -X POST "$API_URL/principals" \
-H "Authorization: Bearer $RAJA_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d "{\"principal\":\"${DEMO_PRINCIPAL}\",\"scopes\":[\"S3Object:${TEST_BUCKET}/*:s3:GetObject\",\"S3Object:${TEST_BUCKET}/*:s3:PutObject\",\"S3Bucket:${TEST_BUCKET}:s3:ListBucket\"]}"
# mint a RAJEE token for that principal
export RAJEE_TOKEN="$(curl -sS -X POST "$API_URL/token" \
-H "Authorization: Bearer $RAJA_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d "{\"principal\":\"${DEMO_PRINCIPAL}\",\"token_type\":\"rajee\"}" | python -c 'import sys,json; print(json.load(sys.stdin)["token"])')"
import os
import boto3
from botocore.config import Config
region = os.environ.get("AWS_REGION") or os.environ.get("AWS_DEFAULT_REGION") or "us-east-1"
endpoint = os.environ["RAJEE_ENDPOINT"]
token = os.environ["RAJEE_TOKEN"]
bucket = os.environ["TEST_BUCKET"]
s3 = boto3.client(
"s3",
endpoint_url=endpoint,
region_name=region,
config=Config(s3={"addressing_style": "path"}),
)
def _headers(request, **_):
request.headers["Host"] = f"s3.{region}.amazonaws.com"
request.headers["x-raja-authorization"] = f"Bearer {token}"
s3.meta.events.register("before-sign.s3", _headers)
s3.put_object(Bucket=bucket, Key="rajee-integration/hello.txt", Body=b"hello")
print(s3.get_object(Bucket=bucket, Key="rajee-integration/hello.txt")["Body"].read())
print([x["Key"] for x in s3.list_objects_v2(Bucket=bucket, Prefix="rajee-integration/").get("Contents", [])])
4) Add Buckets To Test With
- Add a new
aws_s3_bucket(+ versioning/encryption/public-access-block) ininfra/terraform/main.tf. - Add that bucket ARN to both IAM policies in
infra/terraform/main.tf:aws_iam_role_policy.rale_router_permissionsaws_iam_role_policy.rajee_task_permissions
- Add an output in
infra/terraform/outputs.tfif you want the bucket name ininfra/tf-outputs.json. - Re-deploy:
./poe deploy
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file raja-1.1.0.tar.gz.
File metadata
- Download URL: raja-1.1.0.tar.gz
- Upload date:
- Size: 70.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d67532b42df221e2a5c0892da5d05c160123c7b9220ac6b5c3593ad4e66b9546
|
|
| MD5 |
23aa742e33d6b2bc547e9e65d2912da4
|
|
| BLAKE2b-256 |
3904764ab8a6f1c01da917dc350aec570c8fa70c9451017b40663c719902fbfa
|
Provenance
The following attestation bundles were made for raja-1.1.0.tar.gz:
Publisher:
release.yml on quiltdata/raja
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
raja-1.1.0.tar.gz -
Subject digest:
d67532b42df221e2a5c0892da5d05c160123c7b9220ac6b5c3593ad4e66b9546 - Sigstore transparency entry: 1123235128
- Sigstore integration time:
-
Permalink:
quiltdata/raja@af950cf99ebb706c2e18aba82cb25c4722b6035f -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/quiltdata
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@af950cf99ebb706c2e18aba82cb25c4722b6035f -
Trigger Event:
push
-
Statement type:
File details
Details for the file raja-1.1.0-py3-none-any.whl.
File metadata
- Download URL: raja-1.1.0-py3-none-any.whl
- Upload date:
- Size: 82.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bbfd224dbfc0c415f87cf236bb5807ea56c684936290942f8c5cd77c5514349
|
|
| MD5 |
2df30d141735e51f9fdfcff1999e4e6d
|
|
| BLAKE2b-256 |
3e90bf7c9bdbb86290dcdec189309b925b048c779dd0875953b04436d48d4905
|
Provenance
The following attestation bundles were made for raja-1.1.0-py3-none-any.whl:
Publisher:
release.yml on quiltdata/raja
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
raja-1.1.0-py3-none-any.whl -
Subject digest:
6bbfd224dbfc0c415f87cf236bb5807ea56c684936290942f8c5cd77c5514349 - Sigstore transparency entry: 1123235129
- Sigstore integration time:
-
Permalink:
quiltdata/raja@af950cf99ebb706c2e18aba82cb25c4722b6035f -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/quiltdata
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@af950cf99ebb706c2e18aba82cb25c4722b6035f -
Trigger Event:
push
-
Statement type: