Repository navigation
feat: client update setters and get display for scope/bridge fields - #25
Merged
Merged
Conversation
campus client update gains --allowed-scope (repeatable), --clear-allowed-scopes, --upstream-scope provider=scope (repeatable, grouped per provider) and --token-bridge/--no-token-bridge; client get/update output and JSON now carry allowed_scopes, upstream_scopes and token_bridge. List-valued flags REPLACE the stored value wholesale (PATCH full-replace semantics), so the help text says to re-pass everything the client must keep — which is also what makes the additive two-key upstream_scopes patch on the #730 tracker one deliberate command. Also bumps the campus-suite pin to weekly 08d901c so the Client model carries the three fields. Requires the campus-api-python update() params (PR #65); the campus-api-python lock bump follows once that merges. Closes #24
Follows nyjc-computing/campus-api-python#65 — the SDK now accepts the allowed_scopes/upstream_scopes/token_bridge kwargs the flags send.
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.
What
Implements the surface sketched in #24:
campus client updategains:--allowed-scope <scope>(repeatable) and--clear-allowed-scopes(mutually exclusive)--upstream-scope <provider>=<scope>(repeatable; values grouped per provider, first-seen provider order)--token-bridge/--no-token-bridgecampus client get/update/newoutput (table and--json) now carriesallowed_scopes,upstream_scopesandtoken_bridgevia_format_client.Semantics (worth review)
The server's
PATCH /clients/{id}full-replaces every provided field, so the list-valued flags REPLACE the whole stored value — help text and docstring say to re-pass everything the client must keep (same contract as--redirect-uri). Omitted fields are left untouched. Consequences:campus client update -i uid-client-ef56f01c --upstream-scope google=... --upstream-scope google.classroom=...--clear-allowed-scopessends an explicitallowed_scopes=[](fail-closed A1: an empty allowlist grants nothing).provider=scopevalues and the clear+set combination are rejected client-side; the server remains authoritative for the rest (e.g. public clients can't holdtoken_bridge).Dependencies
update()params). Merging this PR before #65 leaves the new flags failing at runtime until the lock bump lands — please merge #65 first.08d901csocampus.model.Clientdeclares the three fields. The campus-api-python lock bump will be pushed to this PR right after #65 merges.Tests
_format_clientcarries/defaults the three fields (fields can't be dropped from--jsonagain, cf. client list/get output omits redirect_uris and is_public #21).token_bridge, the three client-side rejections, dry-run preview, JSON output.Closes #24