Repository navigation
Conversation
|
Claude finished @alukach's task in 24s —— View job ✅ No blocking issues — safe to merge. I read the diff in full (
Minor points, none blocking:
Simplify (ponytail)
💰 Estimated review cost: $0.22 · 0m24s · 6 turns |
alukach
marked this pull request as ready for review
October 15, 2026 01:01
alukach
force-pushed
the
feat/exec-command
branch
from
October 15, 2026 01:01
22c14d0 to
d66b8a0
Compare
source-coop exec -- aws s3 ls s3://acct/prod/ runs any S3 tool as the signed-in user, as aws-vault exec does: the role's current credentials (cached, or minted as creds would) go into the command's environment, with the proxy as AWS_ENDPOINT_URL(_S3) and S3_ENDPOINT_URL, a region if none is set, and AWS_PROFILE removed. On Unix the CLI becomes the command, so its exit code and signals reach the shell directly. creds and exec share current_creds(), which mint() now takes a role and proxy for rather than CredsArgs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GDAL's /vsis3/ (QGIS, rasterio, geopandas) reads no AWS endpoint setting, and object_store before 0.13.2 reads AWS_ENDPOINT rather than AWS_ENDPOINT_URL_S3. Neither can use a credential_process profile on common versions, so they're what exec is most needed for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C2VyGzXgtd9L6f6Rs9xDSZ
Signed out, `exec` now runs the command anyway, unsigned, so public products can be read. It tells GDAL (AWS_NO_SIGN_REQUEST) and object_store (AWS_SKIP_SIGNATURE) not to sign, hides every other AWS key from the command (the proxy refuses keys it doesn't know, even for public data), and says on stderr that it's running unsigned, with the --no-sign-request the AWS CLI and s5cmd need. A session that can't be renewed is still an error. The region given when none is set is now us-west-2, as in `service-account usage`. exec gets help examples, a line in --help's summary for scripts, and its section in "Reading data with AWS tools", with two README demos. The demo stub refuses unsigned listings of products that aren't public, and renewing a session. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alukach
force-pushed
the
feat/exec-command
branch
from
November 9, 2026 06:40
0818edc to
5041a04
Compare
Contributor
|
Docs preview: https://cli.source.coop/pr-preview/pr-43/ Built from b04e957. It goes live a minute or two after this run, once GitHub Pages deploys it, and is removed when the PR closes. |
From review: - Signed in, exec removes AWS_NO_SIGN_REQUEST and AWS_SKIP_SIGNATURE, so GDAL and object_store sign even if they were exported for public buckets. - exec always removes a general AWS_ENDPOINT_URL, which object_store reads as its S3 endpoint and could win over the proxy's AWS_ENDPOINT. - "Nobody signed in" is an Option from current_creds, not a match on an error's text. - The --no-sign-request hint quotes the program as well as its arguments. - creds and the API commands share one "Not signed in" message. README: the signed-out creds message and its exit code in Troubleshooting, and the auth-logout demo re-recorded to show them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep exec's current_creds for creds, with #101's public-data hint on both of its failures: signed out ("Not signed in: …", exit 4) and a session that can't be renewed (mint_failed). The README's Read data subsection mentions exec, and the auth-logout demo is re-recorded with the hint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
source-coop exec -- COMMANDruns any S3 tool with the data proxy as its endpoint, asaws-vault execdoes for AWS. Signed in, the command gets your credentials, so it needs no profile. That matters for tools that can't use thecredential_processprofile or ignore its endpoint: GDAL before 3.12 (most QGIS, rasterio and geopandas installs), Rust'sobject_store(obstore, Polars) and s5cmd. Signed out, the command still runs, unsigned, so anyone can read public products without signing in.How it behaves
--is the command. On Unix the CLI becomes the command (execve), so its exit code and signals (Ctrl+C) reach the shell directly. On Windows it waits and passes the exit code on. A command that can't be started isError: Couldn't run …, exit 1. No command at all is a usage error, exit 2.AWS_ENDPOINT_URL_S3(AWS CLI v2.13+, SDKs),S3_ENDPOINT_URL(s5cmd),AWS_ENDPOINT(object_storebefore 0.13.2, plusAWS_ALLOW_HTTPfor a plain-HTTP proxy), andAWS_S3_ENDPOINT,AWS_HTTPS,AWS_VIRTUAL_HOSTING=FALSE(GDAL/vsis3/). The globalAWS_ENDPOINT_URLisn't set, so a script's calls to other AWS services keep AWS's endpoints.AWS_REGIONandAWS_DEFAULT_REGIONare set tous-west-2, the same asservice-account usagegives, only if neither is already set to a non-empty value.AWS_PROFILE,AWS_DEFAULT_PROFILE,AWS_IGNORE_CONFIGURED_ENDPOINT_URLSandAWS_ENDPOINT_URL, so neither a profile, that switch, nor a general endpoint (LocalStack, say) can send S3 requests anywhere but the proxy.object_storereadsAWS_ENDPOINT_URLas its S3 endpoint, and could otherwise pick it over the proxy'sAWS_ENDPOINT. The cost: a script insideexecthat sends other services to a custom endpoint loses it.AWS_NO_SIGN_REQUESTandAWS_SKIP_SIGNATUREare removed, so GDAL andobject_storesign even if they were exported for public buckets. The command getsAWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_SESSION_TOKENandAWS_CREDENTIAL_EXPIRATION. They're fetched once: cached ones are used only with at least 15 minutes left, otherwise new ones are minted (credskeeps its 60-second margin, since its callers ask again). A command still running when they expire must be run again; long jobs should use the profile.Not signed in, so running unsigned: only public data can be read.AWS_NO_SIGN_REQUEST=YESandobject_storegetsAWS_SKIP_SIGNATURE=true.s3://cholmes/admin-boundaries/getsAccessDenied).AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_SESSION_TOKEN,AWS_SECURITY_TOKEN,AWS_CREDENTIAL_EXPIRATION,AWS_ROLE_ARN,AWS_WEB_IDENTITY_TOKEN_FILE,AWS_ROLE_SESSION_NAMEand theAWS_CONTAINER_*credential variables are removed;AWS_SHARED_CREDENTIALS_FILEandAWS_CONFIG_FILEpoint at/dev/null(NULon Windows);AWS_EC2_METADATA_DISABLED=true. This also keeps a user's real AWS access key ID from being sent to the proxy.Unable to locate credentials/NoCredentialProviders, so when the command isawsors5cmdwithout--no-sign-request, stderr addsaws needs --no-sign-request to run unsigned: source-coop exec -- aws --no-sign-request s3 ls …, with the arguments quoted for the shell.execdoesn't add the flag itself: it doesn't rewrite the command it was given.AccessDenied), and the command's exit code is passed on.creds(Couldn't get new credentials (…). Run 'source-coop auth login'., exit 1), and the command isn't run. Someone who signed in means to act as themselves; silently running unsigned would turn that into a puzzlingAccessDeniedon their own data, or a write that fails.auth logoutmakes the unsigned run available again.credssigned out saysNot signed in: run 'source-coop auth login'.(the same message the API commands give), followed by docs: say in --help where the data is and that public data needs no sign-in #101'sPublic data needs no credentials: …hint, and exits 4. A session that can't be renewed gets the same hint, through docs: say in --help where the data is and that public data needs no sign-in #101'smint_failed, forcredsandexecalike. Before, it wasCouldn't get new credentials (not logged in). …, exit 1. README Troubleshooting has the new message.--json: the output is the command's.execis listed with the other exceptions in the README.--helphas examples, what the command gets and what happens signed out, andsource-coop --help's summary for scripts points atexecfor reading and writing data.Demos
These run against the demo stub (
docs/recorder/stub.py), not source.coop:record.pydraws the stub's URLs as production's, and the records and keys are made up.exec: the AWS CLI and s5cmd with your credentials and the proxy, no profileexecsigned out: unsigned, a public product listed, a restricted one refusedexecsigned out: what GDAL, object_store and the AWS tools are toldexec: the command's exit code, a command that isn't there, and none at allexecsigned in, but the session can't be renewed: an error, not an unsigned runDocs changes
exec: examples, what the command gets, the 15-minute credential rule, the signed-out behaviour and the error when a session can't be renewed, with two new demos (docs/demos/exec.svg,docs/demos/exec-signed-out.svg): https://cli.source.coop/pr-preview/pr-43/reading-data-with-aws-tools/#run-a-tool-with-execexecwrites too, signed in: https://cli.source.coop/pr-preview/pr-43/uploading-data-with-aws-tools/execamong the commands without--json, and points at it for reading and writing data: https://cli.source.coop/pr-preview/pr-43/scripts-and-ai-agents/#jsonSOURCE_ROLE_ARNapplies toexec: https://cli.source.coop/pr-preview/pr-43/configuration/Couldn't get new credentialsentry namesexectoo, and a new entry coversUnable to locate credentialsunderexec: https://cli.source.coop/pr-preview/pr-43/troubleshooting/exec: https://cli.source.coop/pr-preview/pr-43/Not in this PR
credential_processshould use the profile, which renews them. Worth adding (for example a local credentials endpoint the child polls viaAWS_CONTAINER_CREDENTIALS_FULL_URI) if people run multi-hour jobs throughexec.--no-sign-requesttoaws/s5cmdautomatically.execonly suggests it, so the command runs exactly as typed. Worth revisiting if the suggestion proves to be noise.AWS_ENDPOINT_URL_STS. Not set: the command already holds credentials (or runs unsigned), so it never needs the proxy's STS, and a script's own STS calls keep going to AWS.service-account usagesets it because there the SDK exchanges a web identity token itself.credsalways has; that message is shared withcreds, and changing its classification belongs in its own PR.aws-vault execwould mean changing that table.--durationof 15 minutes or less. Cached credentials then never meetexec's 15-minute minimum, so each run mints new ones, which still last less than 15 minutes. A design question about the minimum, not a local fix.botocore.UNSIGNED).Follow-ups elsewhere
--no-sign-request. Treating an unknown key as anonymous (for reads of public products) would make this less surprising.execworks around it by hiding other keys.Testing
cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo testandcargo test --features staging: 188 passed, 1 ignored, with docs: say in --help where the data is and that public data needs no sign-in #101 merged in from main. The exec tests are 7 insrc/exec.rs(signed and unsigned environments, including the switches and endpoint removed; a local HTTP proxy; a region already set; the--no-sign-requesthint, quoting both arguments and a program path with a space; no command) and 1 insrc/main.rs(the notes printed). Whether anyone is signed in is now anOptionfromcurrent_credsrather than a match on an error's text. The README'sauth-logoutdemo is re-recorded for the newcredsmessage, plusexpires_withininsrc/cache.rs.uv run --with jsonschema python docs/recorder/check_stub.py: all routes match the staging spec. The docs site builds (docs/site/build.py).HOMEand a made-up environment (a local read-only forwarder tohttps://data.source.coop, so no keychain item or real session was read), and fakeAWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/AWS_PROFILEin the environment:aws --no-sign-request s3 ls,s5cmd --no-sign-request ls, GDALogrinfo /vsis3/…and obstoreS3Store(...).list()all listeds3://cholmes/admin-boundaries/; no request reached the proxy signed;aws s3 lswithout the flag printed the hint and failed withUnable to locate credentials;sh -c 'exit 7'exited 7.🤖 Generated with Claude Code