Skip to content
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

Add OAuth2 Support #15 #23

Merged
merged 12 commits into from
May 4, 2018
Merged

Add OAuth2 Support #15 #23

merged 12 commits into from
May 4, 2018

Conversation

sserrata
Copy link
Member

@sserrata sserrata commented May 2, 2018

Overview

  • Add OAuth2 support for performing token refresh and revocation
  • Add support to HTTPClient for auto-refresh
  • Add support for storing credentials in ~/.config/pancloud and as environment variables

Implementation

  • Added credentials module that supports construction of Credentials object
  • Added property methods for retrieving access_token, client_id, client_secret, and refresh_token.
  • Add the following methods: _fetch_credentia, get_credentials, remove_profile, refresh, write_credentials.
  • Using TinyDB library to upsert and store credentials in JSON format in ~/.config/pancloud directory.
  • Added methods revoke_access_token and revoke_refresh_token.
  • Added _resolve_credential method which looks for credential in 1) ENVIRON, 2) Credentials file.
  • Added region, redirect_uri and auth_base_url variables/attributes.
  • Added method get_authorization_url for generating authorization URL and returning state.
  • Integrated Credentials with HTTPClient to support auto_refresh and automatic application of access_token to Authorization: Bearer header.

@sserrata sserrata requested a review from kevinsteves May 2, 2018 23:11
@sserrata sserrata self-assigned this May 2, 2018
@sserrata sserrata added the enhancement New feature or request label May 2, 2018
Copy link
Contributor

@kevinsteves kevinsteves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get this in.

@sserrata sserrata merged commit 13024a3 into PaloAltoNetworks:master May 4, 2018
@sserrata sserrata deleted the feature-credentials branch May 12, 2018 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants