Skip to content

Commit 3e53df7

Browse files
Merge pull request #35 from planetlabs/carl/cherry-pick
update command help to have fewer truncated short descriptions.
2 parents de77851 + 8e09b04 commit 3e53df7

File tree

4 files changed

+23
-13
lines changed

4 files changed

+23
-13
lines changed

src/planet_auth_utils/commands/cli/main.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,12 @@ def cmd_plauth_login(
183183
yes,
184184
):
185185
"""
186-
Perform an initial login, obtain user authorization, and save access
187-
tokens for the selected authentication profile. The specific process
188-
used depends on the selected options and authentication profile.
186+
Perform an initial login.
187+
188+
This command performs an initial login, obtains user authorization,
189+
and saves access tokens for the selected authentication profile.
190+
The specific process used depends on the selected options and
191+
authentication profile.
189192
"""
190193
extra = {}
191194
if project:

src/planet_auth_utils/commands/cli/oauth_cmd.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ def cmd_oauth_refresh(ctx, scope):
142142
It is possible to request a refresh token with scopes that are different
143143
from what is currently possessed, but you will never be granted
144144
more scopes than what the user has authorized.
145+
146+
This command only applies to auth profiles that use OAuth access tokens.
145147
"""
146148
saved_token = FileBackedOidcCredential(None, ctx.obj["AUTH"].token_file_path())
147149
auth_client = ctx.obj["AUTH"].auth_client()
@@ -344,7 +346,8 @@ def cmd_oauth_revoke_refresh_token(ctx):
344346
@recast_exceptions_to_click(AuthException, FileNotFoundError)
345347
def cmd_oauth_userinfo(ctx):
346348
"""
347-
Look up user information from the auth server using the access token.
349+
Look up user information for the current user. Look up is performed by
350+
querying the authorization server using the current access token.
348351
"""
349352
saved_token = FileBackedOidcCredential(None, ctx.obj["AUTH"].token_file_path())
350353
auth_client = ctx.obj["AUTH"].auth_client()
@@ -362,6 +365,7 @@ def cmd_oauth_userinfo(ctx):
362365
def cmd_oauth_print_access_token(ctx, refresh):
363366
"""
364367
Show the current OAuth access token. Stale tokens will be automatically refreshed.
368+
This command only applies to auth profiles that use OAuth access tokens.
365369
"""
366370
saved_token = FileBackedOidcCredential(None, ctx.obj["AUTH"].token_file_path())
367371
saved_token.load()
@@ -394,8 +398,8 @@ def cmd_oauth_print_access_token(ctx, refresh):
394398
@recast_exceptions_to_click(AuthException, FileNotFoundError)
395399
def cmd_oauth_decode_jwt_access_token(ctx, human_readable):
396400
"""
397-
Decode a JWT access token locally and display its contents. NO
398-
VALIDATION IS PERFORMED. This function is intended for local
401+
Decode a JWT access token locally.
402+
NO VALIDATION IS PERFORMED. This function is intended for local
399403
debugging purposes. Note: Access tokens need not be JWTs.
400404
This function will not work for authorization servers that issue
401405
access tokens in other formats.
@@ -410,8 +414,8 @@ def cmd_oauth_decode_jwt_access_token(ctx, human_readable):
410414
@recast_exceptions_to_click(AuthException, FileNotFoundError)
411415
def cmd_oauth_decode_jwt_id_token(ctx, human_readable):
412416
"""
413-
Decode a JWT ID token locally and display its contents. NO
414-
VALIDATION IS PERFORMED. This function is intended for local
417+
Decode a JWT ID token locally.
418+
NO VALIDATION IS PERFORMED. This function is intended for local
415419
debugging purposes.
416420
"""
417421
saved_token = FileBackedOidcCredential(None, ctx.obj["AUTH"].token_file_path())
@@ -424,8 +428,8 @@ def cmd_oauth_decode_jwt_id_token(ctx, human_readable):
424428
@recast_exceptions_to_click(AuthException, FileNotFoundError)
425429
def cmd_oauth_decode_jwt_refresh_token(ctx, human_readable):
426430
"""
427-
Decode a JWT refresh token locally and display its contents. NO
428-
VALIDATION IS PERFORMED. This function is intended for local
431+
Decode a JWT refresh token locally.
432+
NO VALIDATION IS PERFORMED. This function is intended for local
429433
debugging purposes. Note: Refresh tokens need not be JWTs.
430434
This function will not work for authorization servers that issue
431435
refresh tokens in other formats.

src/planet_auth_utils/commands/cli/planet_legacy_auth_cmd.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ def cmd_pllegacy_login(ctx, username, password, sops, yes):
8989
@recast_exceptions_to_click(AuthException, FileNotFoundError)
9090
def cmd_pllegacy_print_api_key(ctx):
9191
"""
92-
Show the API Key used by the currently selected authentication profile.
92+
Show the current API Key. This command only applies to auth profiles
93+
that use simple API keys.
9394
"""
9495
# We also support StaticApiKeyAuthClient in some cases where the user
9596
# directly provides an API key. Such clients can use the legacy API
@@ -119,7 +120,7 @@ def cmd_pllegacy_print_api_key(ctx):
119120
@recast_exceptions_to_click(AuthException, FileNotFoundError)
120121
def cmd_pllegacy_print_access_token(ctx):
121122
"""
122-
Show the legacy JWT currently held by the selected authentication profile.
123+
Show the current legacy JWT access token.
123124
"""
124125
_check_client_type_pllegacy(ctx)
125126
saved_token = FileBackedPlanetLegacyApiKey(api_key_file=ctx.obj["AUTH"].token_file_path())

src/planet_auth_utils/commands/cli/profile_cmd.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,9 @@ def cmd_profile_copy(sops, src, dst):
271271
@recast_exceptions_to_click(AuthException, FileNotFoundError, PermissionError)
272272
def cmd_profile_set(selected_profile):
273273
"""
274-
Configure the default authentication profile to use when one is not otherwise specified.
274+
Configure the default authentication profile. Preference will be saved to disk
275+
and will be used when one is not otherwise specified. Command line options
276+
and environment variables override on-disk preferences.
275277
"""
276278
if not selected_profile:
277279
selected_profile = _dialogue_choose_auth_profile()

0 commit comments

Comments
 (0)