Skip to content

updates from beta feedback #1148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main-3.0-dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions planet/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ def from_profile(profile_name: str) -> Auth:

This method does not support the use a custom storage provider.
"""
if not profile_name:
raise APIKeyAuthException('Profile name cannot be empty.')
pl_authlib_context = planet_auth_utils.PlanetAuthFactory.initialize_auth_client_context(
auth_profile_opt=profile_name)
return _PLAuthLibAuth(plauth=pl_authlib_context)
Expand Down
1 change: 1 addition & 0 deletions planet/cli/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@ def cmd_auth_profile(ctx):
cmd_auth_profile.add_command(name="show",
cmd=planet_auth_utils.cmd_profile_show)
cmd_auth_profile.add_command(name="set", cmd=planet_auth_utils.cmd_profile_set)
cmd_auth_profile.add_command(name="copy", cmd=planet_auth_utils.cmd_profile_copy)
cmd_auth.add_command(cmd_auth_profile)
6 changes: 5 additions & 1 deletion planet/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,16 @@ def _configure_cli_auth_ctx(ctx,
auth_client_secret,
auth_api_key):
# planet-auth library Auth context type
# Embedded click commands imported from planet_auth_utils expect
# this in the 'AUTH' context field.
ctx.obj[
'AUTH'] = planet_auth_utils.PlanetAuthFactory.initialize_auth_client_context(
auth_profile_opt=auth_profile,
auth_client_id_opt=auth_client_id,
auth_client_secret_opt=auth_client_secret,
auth_api_key_opt=auth_api_key)
auth_api_key_opt=auth_api_key,
use_env=True,
use_configfile=True)

# planet SDK Auth context type
ctx.obj['PLSDK_AUTH'] = planet.Auth._from_plauth(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies = [
"pyjwt>=2.1",
"tqdm>=4.56",
"typing-extensions",
"planet-auth==2.0.11b1746663950",
"planet-auth==2.0.11b1746663950", # TODO - update
]
readme = "README.md"
requires-python = ">=3.9"
Expand Down
Loading