Repository navigation
feat(sdk): providerKeys on environments, connector credential type and codes - #28
Merged
Merged
Conversation
…d codes Adds client.environments (list, get, update) with provider_keys "gateway" | "plain", credential_type on Connector, and the ConnectorTokenInvalidError / ConnectorUnreachableError subclasses. Closes #27 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Environment Matches the JS and Go Environment types. Documents that update needs an organization admin for every field and which fields mint a new version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
parnexcodes
commented
Oct 11, 2026
parnexcodes
left a comment
Member
Author
There was a problem hiding this comment.
Review: feat(sdk): providerKeys on environments, connector credential type and codes (dock-python)
Verdict: SHIP (after fix dda2beb)
Blocking (fixed in dda2beb)
src/usedock/models.pyEnvironmentdroppedsafeForThirdParties,passGithub,passSecrets,passDockCredentials,passAgentsCredentials,varNames,createdAtandupdatedAt, which the JS and Go types expose. Failure: afterupdate(pass_github=False)a Python caller had no typed way to read the posture back, only.raw. Fix: added the fields. Tests:test_environment_reads_posture_fieldsandtest_environments_update_sends_posture_and_egress_list.- The
updatedocstring and README said onlyprovider_keys="plain"needs an admin. The API requires an admin for every update. Corrected, and the version semantics are now documented.
Verified against usedock/dock main
- Routes:
GET /v1/environments?organizationId=(required uuid),GETandPATCH /v1/environments/:refwith optionalorganizationIdfor name refs (environments.controller.ts). These are public, documented routes (documentation/content/docs/api/environments.mdx). UpdateEnvironmentDtoaccepts exactlyname, isDefault, secretsAccess, safeForThirdParties, passGithub, passSecrets, passDockCredentials, passAgentsCredentials, providerKeys, egressAllow(nullable). All three SDKs now expose that same set.- Roles:
getByRef/listByOrgneed a member;updatecallsresolveRef(..., 'admin'), so every PATCH needs an admin, not onlyproviderKeys: plain. Docs in all three SDKs now say this. - Versions: only posture fields (pass flags,
safeForThirdParties,providerKeys,egressAllow) go throughbumpVersion.name,isDefaultandsecretsAccessupdate the environment row without a new version. This is now documented that way. toViewreturnsvarNames, file{path,size}, repos and connection status, never values. The SDK types carry no secret values.connector_token_invalid400 andconnector_unreachable502 come fromconnectors/connector-verify.ts.credentialTypevalues matchCONNECTOR_CREDENTIAL_TYPESand arenullwhen not connected.- Additive only (new resource, new optional fields, new codes), so this is a semver minor.
Non-blocking (outside these PRs)
documentation/content/docs/api/environments.mdx(usedock/dock): the PATCH field table leaves outproviderKeys. It is covered in concepts/model-keys/threat-model but not in the API reference. This belongs in a follow-up on the dock repo.
Checks
ruff check .: passruff format --check .: passmypy: passpytest(DOCK_SCENARIOS_DIR at pinned ref): 114 passed, 9 skipped (live)- CI on dda2beb: all green
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Closes #27
What
client.environmentsresource:list(organization_id),get(ref, organization_id=...),update(ref, ..., provider_keys=...)with anEnvironmentdataclass (provider_keys,is_default,current_version,secrets_access,egress_allow,raw).provider_keys"gateway"(default) or"plain", documented on the dataclass andupdate.egress_allow=Noneclears the allowlist (UNSET keeps it).credential_typeonConnector(oauth | personal_token | bot_token | org_token | user_token | token | None).ConnectorTokenInvalidError(connector_token_invalid, 400) andConnectorUnreachableError(connector_unreachable, 502), exported fromusedock.Why
usedock/dock#106 added
providerKeysto environments and dock#86 the connector credential type; the SDK had no environments surface, so the setting could not be read or changed. The two connector codes had no typed errors.How to verify
ruff check . && ruff format --check . && mypy && pytest. New tests cover environment list/get/update (sending and readingprovider_keys, egress null),credential_type, and the two typed errors. Shared scenarios pass against usedock/dock main (fac9293);SCENARIOS_REFis unchanged because only a fixture changed since the pin.Risk
Additive only.
Environment.provider_keysdefaults to"gateway"when the field is absent (older servers).🤖 Generated with Claude Code