-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for timer create with data_access (#699)
* Add support for timer create with data_access Subsequent to the changes below, `globus timer create transfer` is no longer marked hidden and it is included in the changelog. This therefore marks the "release" of `globus timer create transfer` as a command. The data access check is now followed by a check against the Auth Consents API if data_access scopes are required. The Consents API data can be assumed to match a specific shape due to the enforcement of "contract versions" on CLI scopes. We do not request or need the view_consents scope at present, as the Consents API does not require this in order for the CLI to see its own consents. In order to use the Consents API, the CLI now pulls the user's ID from storage, so tests now mock the partial userinfo data which is written at the end of a login flow. Client Credentials handling is not included for now. If client credentials are used to run `globus timer create transfer` against a collection with `data_access`, an explicit usage error is thrown for now. In the future, it should be possible to use client creds to request a new token which has the required dependency, but this is explicitly set aside as future work. 'session consent' is enhanced to allow timer-based data_access scopes to be requested more easily. Rather than presenting the whole (long, even unsightly) scope string on the command line, define an aliasing option for this purpose which makes the `globus session consent` command more approachable. This puts usage of `compute_timer_scope()` into the internals for `globus session consent --timer-data-access ...`. On the one hand, this "dirties" the design of `globus session consent`, in that the command is no longer fully generic and now contains service-specific details. On the other hand, making this comprommise lets us provide users with a more coordinated experience across various parts of the CLI, in which they don't need to traffic in as much information. Even if the information is only ever copy-pasted, exposing it directly to the user makes the commands more error-prone and less clear to read and reason about. ---- This work was rebased and squashed from prior work. It is possible that some detail was lost in the process. Co-authored-by: Kurt McKee <contactme@kurtmckee.org> * Update src/globus_cli/login_manager/__init__.py * Resolve typing issue introduced by rebase `list[str]` does not match `list[str | X]` because `list` is invariant. Either we use a covariant type in the helper like `Sequence`, or we expand the type of the scope list to `str | MutableScope` to match the type of the helper. --------- Co-authored-by: Kurt McKee <contactme@kurtmckee.org>
- Loading branch information
Showing
6 changed files
with
329 additions
and
39 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
### Enhancements | ||
|
||
* Add `globus timer create transfer` as a new command for creating new timers | ||
|
||
** The command prompts for login if data_access consents are detected as a | ||
requirement | ||
|
||
* `globus session consent` now supports a `--timer-data-access` flag, specifically | ||
to help support timer creation |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.