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

feat: implement access_token auth method #668

Merged
merged 3 commits into from
Jun 26, 2024

Conversation

0x416e746f6e
Copy link
Contributor

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes #660

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (improve existing resource(s) or datasource(s))
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A: make testacc TESTARGS="-run TestAccDataSourceXxxxYyyyZzzzz_basic"
  • Test B: make testacc TESTARGS="-run TestAccDataSourceXxxxYyyyZzzzz_basic"

Test Configuration:

  • Terraform version: terraform version: Terraform v1.8.5
  • Existing HCL configuration you used:
#
# this is what I really did.  but setting up the whole vault, and oauth2 plugin, 
# and configuring ovh auth engine, is not really necessary.  just passing the 
# token received from `/auth/oauth2/token` as hardcoded `access_token` argument
# will also do
#
data "vault_generic_secret" "this" {
  path = "secret/oauth2/self/ovh-eu"
}

provider "ovh" {
  endpoint = var.ovh_endpoint
  
  access_token = data.vault_generic_secret.this.data["access_token"]
}

data "ovh_me" "this" {}

output "ovh_me" {
  value = data.ovh_me.this
}

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or issues
  • I have added acceptance tests that prove my fix is effective or that my feature works
  • New and existing acceptance tests pass locally with my changes
  • I ran succesfully go mod vendor if I added or modify go.mod file

amstuta
amstuta previously approved these changes Jun 25, 2024
Copy link
Contributor

@amstuta amstuta left a comment

Choose a reason for hiding this comment

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

Thanks for this PR @0x416e746f6e , I just suggested a small fix but the rest is ok for me !

website/docs/index.html.markdown Outdated Show resolved Hide resolved
@amstuta amstuta merged commit 81b60aa into ovh:master Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Support access_token based provider authentication
2 participants