Skip to content

Commit

Permalink
Merge pull request #876 from hashicorp/tests/oidc
Browse files Browse the repository at this point in the history
Bugfix: incorrect OIDC method selection
  • Loading branch information
manicminer authored Aug 30, 2022
2 parents 73d8d6e + 2541d45 commit 990eb29
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 6 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/acctest-oidc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: "Acceptance Tests: OIDC"
on:
pull_request:
types: ['opened', 'synchronize']
paths:
- '.github/workflows/acctest-oidc.yaml'
- 'internal/provider/**'
- 'vendor/github.com/manicminer/hamilton/auth/**'

permissions:
contents: read
id-token: write

jobs:
go-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.go-version.outputs.version }}
steps:
- uses: actions/checkout@v2

- id: go-version
run: echo "::set-output name=version::$(cat ./.go-version)"

acctest-oidc:
needs: go-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '${{ needs.go-version.outputs.version }}'
- run: bash scripts/gogetcookie.sh
- run: make tools
- run: |
echo "ARM_OIDC_TOKEN=$(curl -H "Accept: application/json; api-version=2.0" -H "Authorization: Bearer ${ACTIONS_ID_TOKEN_REQUEST_TOKEN}" -H "Content-Type: application/json" -G --data-urlencode "audience=api://AzureADTokenExchange" "${ACTIONS_ID_TOKEN_REQUEST_URL}" | jq -r '.value')" >>$GITHUB_ENV
- run: make testacc TEST=./internal/provider TESTARGS="-run '(?i)(TestAccProvider_.*oidc.*)'"
env:
ARM_CLIENT_ID: ${{ secrets.OIDC_CLIENT_ID }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require (
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/go-uuid v1.0.3
github.com/hashicorp/terraform-plugin-sdk/v2 v2.17.0
github.com/manicminer/hamilton v0.47.0
github.com/manicminer/hamilton v0.47.1
golang.org/x/text v0.3.7
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/manicminer/hamilton v0.47.0 h1:k7IiugZ2gL9OrX59OSNQ9Kld4Nl3xG8wh3VP5ltGtO0=
github.com/manicminer/hamilton v0.47.0/go.mod h1:lbVyngC+/nCWuDp8UhC6Bw+bh7jcP/E+YwqzHTmzemk=
github.com/manicminer/hamilton v0.47.1 h1:nMH4oOa2lPAfCeLGEB1o+XzhyJUHPRimlWz/hB2WC5E=
github.com/manicminer/hamilton v0.47.1/go.mod h1:lbVyngC+/nCWuDp8UhC6Bw+bh7jcP/E+YwqzHTmzemk=
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
Expand Down
4 changes: 2 additions & 2 deletions vendor/github.com/manicminer/hamilton/auth/auth.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ github.com/hashicorp/terraform-svchost
# github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87
## explicit; go 1.15
github.com/hashicorp/yamux
# github.com/manicminer/hamilton v0.47.0
# github.com/manicminer/hamilton v0.47.1
## explicit; go 1.16
github.com/manicminer/hamilton/auth
github.com/manicminer/hamilton/environments
Expand Down

0 comments on commit 990eb29

Please sign in to comment.