Clarify auth source, CLI only sources from config file #809
  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.
  
    
  
    
Related Issue(s):
Closes #808 and #699 and #396
Proposed Changes:
For inclusion in changelog (if applicable):
planet auth storeto allow storing authorization in the secret file. This command raises a confirmation prompt.planet auth storeorplanet auth initare used and the authorization environment variable exists, a warning message is printed with instructions for how to update the environment variable, if desiredauth.Auth.write()renamed toauth.Auth.store()to match CLI commandNot intended for changelog:
CliSession()now manages authorization information in addition to headers instead of managing authorization information in Click context. This has the benefit of only obtaining authorization when aCliSession()is created so not every time something likeplanet data --helpis called.CLISession()to ensure auth information is obtained from the file and that expected headers are sent.Diff of User Interface
Scenario 1: Authorization environment variable exists with value
ENVAPIKEYand config file exists with valueCONFIGAPIKEYOld behavior:
New behavior:
Scenario 2: Authorization environment variable exists. It is desired to update the config file
Old behavior:
New behavior:
Scenario 3: It is desired to update the config file authorization from the environment variable.
Old behavior:
New behavior:
PR Checklist:
(Optional) @mentions for Notifications: