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

Ensure all AuthLogin instances are validated on call to Login(). #1631

Merged
merged 1 commit into from
Oct 11, 2022

Conversation

benashz
Copy link
Contributor

@benashz benashz commented Oct 11, 2022

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Relates #1627

Release note for CHANGELOG:


Output from acceptance testing:

$ make testacc-ent SKIP_VAULT_NEXT_TESTS=1 TESTARGS='-v -test.run TestAuthLogin -test.count=1'
make testacc TF_ACC_ENTERPRISE=1
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test -v -test.run TestAuthLogin -test.count=1 -timeout 30m ./...

=== RUN   TestAuthLoginAWS_Init
=== RUN   TestAuthLoginAWS_Init/basic
=== RUN   TestAuthLoginAWS_Init/error-missing-resource
=== RUN   TestAuthLoginAWS_Init/error-missing-required
--- PASS: TestAuthLoginAWS_Init (0.00s)
    --- PASS: TestAuthLoginAWS_Init/basic (0.00s)
    --- PASS: TestAuthLoginAWS_Init/error-missing-resource (0.00s)
    --- PASS: TestAuthLoginAWS_Init/error-missing-required (0.00s)
=== RUN   TestAuthLoginAWS_LoginPath
=== RUN   TestAuthLoginAWS_LoginPath/default
=== RUN   TestAuthLoginAWS_LoginPath/other
--- PASS: TestAuthLoginAWS_LoginPath (0.00s)
    --- PASS: TestAuthLoginAWS_LoginPath/default (0.00s)
    --- PASS: TestAuthLoginAWS_LoginPath/other (0.00s)
=== RUN   TestAuthLoginAWS_getCredentialsConfig
=== RUN   TestAuthLoginAWS_getCredentialsConfig/static-creds
=== RUN   TestAuthLoginAWS_getCredentialsConfig/static-creds-with-profile
=== RUN   TestAuthLoginAWS_getCredentialsConfig/all
--- PASS: TestAuthLoginAWS_getCredentialsConfig (0.00s)
    --- PASS: TestAuthLoginAWS_getCredentialsConfig/static-creds (0.00s)
    --- PASS: TestAuthLoginAWS_getCredentialsConfig/static-creds-with-profile (0.00s)
    --- PASS: TestAuthLoginAWS_getCredentialsConfig/all (0.00s)
=== RUN   TestAuthLoginAWS_Login
=== RUN   TestAuthLoginAWS_Login/error-uninitialized
--- PASS: TestAuthLoginAWS_Login (0.00s)
    --- PASS: TestAuthLoginAWS_Login/error-uninitialized (0.00s)
=== RUN   TestAuthLoginAzure_Init
=== RUN   TestAuthLoginAzure_Init/basic
=== RUN   TestAuthLoginAzure_Init/error-missing-resource
=== RUN   TestAuthLoginAzure_Init/error-missing-required
=== RUN   TestAuthLoginAzure_Init/error-missing-one-of
--- PASS: TestAuthLoginAzure_Init (0.00s)
    --- PASS: TestAuthLoginAzure_Init/basic (0.00s)
    --- PASS: TestAuthLoginAzure_Init/error-missing-resource (0.00s)
    --- PASS: TestAuthLoginAzure_Init/error-missing-required (0.00s)
    --- PASS: TestAuthLoginAzure_Init/error-missing-one-of (0.00s)
=== RUN   TestAuthLoginAzure_LoginPath
=== RUN   TestAuthLoginAzure_LoginPath/default
=== RUN   TestAuthLoginAzure_LoginPath/other
--- PASS: TestAuthLoginAzure_LoginPath (0.00s)
    --- PASS: TestAuthLoginAzure_LoginPath/default (0.00s)
    --- PASS: TestAuthLoginAzure_LoginPath/other (0.00s)
=== RUN   TestAuthLoginAzure_Login
=== RUN   TestAuthLoginAzure_Login/auth-with-jwt
=== RUN   TestAuthLoginAzure_Login/auth-with-az-identity
    auth_azure_test.go:249: "TF_ACC_AZURE_AUTH" must be set
=== RUN   TestAuthLoginAzure_Login/error-uninitialized
--- PASS: TestAuthLoginAzure_Login (0.00s)
    --- PASS: TestAuthLoginAzure_Login/auth-with-jwt (0.00s)
    --- SKIP: TestAuthLoginAzure_Login/auth-with-az-identity (0.00s)
    --- PASS: TestAuthLoginAzure_Login/error-uninitialized (0.00s)
=== RUN   TestAuthLoginCert_Init
=== RUN   TestAuthLoginCert_Init/without-role-name
=== RUN   TestAuthLoginCert_Init/with-role-name
=== RUN   TestAuthLoginCert_Init/with-namespace
=== RUN   TestAuthLoginCert_Init/all-params
=== RUN   TestAuthLoginCert_Init/error-missing-resource
--- PASS: TestAuthLoginCert_Init (0.00s)
    --- PASS: TestAuthLoginCert_Init/without-role-name (0.00s)
    --- PASS: TestAuthLoginCert_Init/with-role-name (0.00s)
    --- PASS: TestAuthLoginCert_Init/with-namespace (0.00s)
    --- PASS: TestAuthLoginCert_Init/all-params (0.00s)
    --- PASS: TestAuthLoginCert_Init/error-missing-resource (0.00s)
=== RUN   TestAuthLoginCert_LoginPath
=== RUN   TestAuthLoginCert_LoginPath/default
--- PASS: TestAuthLoginCert_LoginPath (0.00s)
    --- PASS: TestAuthLoginCert_LoginPath/default (0.00s)
=== RUN   TestAuthLoginCert_Login
=== RUN   TestAuthLoginCert_Login/default
=== RUN   TestAuthLoginCert_Login/named-role
=== RUN   TestAuthLoginCert_Login/error-uninitialized
--- PASS: TestAuthLoginCert_Login (0.00s)
    --- PASS: TestAuthLoginCert_Login/default (0.00s)
    --- PASS: TestAuthLoginCert_Login/named-role (0.00s)
    --- PASS: TestAuthLoginCert_Login/error-uninitialized (0.00s)
=== RUN   TestAuthLoginGCP_Init
=== RUN   TestAuthLoginGCP_Init/error-missing-resource
--- PASS: TestAuthLoginGCP_Init (0.00s)
    --- PASS: TestAuthLoginGCP_Init/error-missing-resource (0.00s)
=== RUN   TestAuthLoginGCP_LoginPath
=== RUN   TestAuthLoginGCP_LoginPath/default
--- PASS: TestAuthLoginGCP_LoginPath (0.00s)
    --- PASS: TestAuthLoginGCP_LoginPath/default (0.00s)
=== RUN   TestAuthLoginGCP_Login
=== RUN   TestAuthLoginGCP_Login/role-jwt
=== RUN   TestAuthLoginGCP_Login/role-credentials
    auth_gcp_test.go:194: "GOOGLE_APPLICATION_CREDENTIALS" must be set
=== RUN   TestAuthLoginGCP_Login/no-jwt
=== RUN   TestAuthLoginGCP_Login/error-uninitialized
--- PASS: TestAuthLoginGCP_Login (0.00s)
    --- PASS: TestAuthLoginGCP_Login/role-jwt (0.00s)
    --- SKIP: TestAuthLoginGCP_Login/role-credentials (0.00s)
    --- PASS: TestAuthLoginGCP_Login/no-jwt (0.00s)
    --- PASS: TestAuthLoginGCP_Login/error-uninitialized (0.00s)
=== RUN   TestAuthLoginJWT_Init
=== RUN   TestAuthLoginJWT_Init/basic
=== RUN   TestAuthLoginJWT_Init/error-missing-resource
=== RUN   TestAuthLoginJWT_Init/error-missing-required
--- PASS: TestAuthLoginJWT_Init (0.00s)
    --- PASS: TestAuthLoginJWT_Init/basic (0.00s)
    --- PASS: TestAuthLoginJWT_Init/error-missing-resource (0.00s)
    --- PASS: TestAuthLoginJWT_Init/error-missing-required (0.00s)
=== RUN   TestAuthLoginJWT_LoginPath
=== RUN   TestAuthLoginJWT_LoginPath/default
--- PASS: TestAuthLoginJWT_LoginPath (0.00s)
    --- PASS: TestAuthLoginJWT_LoginPath/default (0.00s)
=== RUN   TestAuthLoginJWT_Login
=== RUN   TestAuthLoginJWT_Login/basic
=== RUN   TestAuthLoginJWT_Login/error-uninitialized
--- PASS: TestAuthLoginJWT_Login (0.00s)
    --- PASS: TestAuthLoginJWT_Login/basic (0.00s)
    --- PASS: TestAuthLoginJWT_Login/error-uninitialized (0.00s)
=== RUN   TestAuthLoginKerberos_Init
=== RUN   TestAuthLoginKerberos_Init/with-token
=== RUN   TestAuthLoginKerberos_Init/error-missing-resource
=== RUN   TestAuthLoginKerberos_Init/error-missing-required
--- PASS: TestAuthLoginKerberos_Init (0.00s)
    --- PASS: TestAuthLoginKerberos_Init/with-token (0.00s)
    --- PASS: TestAuthLoginKerberos_Init/error-missing-resource (0.00s)
    --- PASS: TestAuthLoginKerberos_Init/error-missing-required (0.00s)
=== RUN   TestAuthLoginKerberos_LoginPath
=== RUN   TestAuthLoginKerberos_LoginPath/default
--- PASS: TestAuthLoginKerberos_LoginPath (0.00s)
    --- PASS: TestAuthLoginKerberos_LoginPath/default (0.00s)
=== RUN   TestAuthLoginKerberos_Login
=== RUN   TestAuthLoginKerberos_Login/with-token
=== RUN   TestAuthLoginKerberos_Login/no-token
--- PASS: TestAuthLoginKerberos_Login (0.00s)
    --- PASS: TestAuthLoginKerberos_Login/with-token (0.00s)
    --- PASS: TestAuthLoginKerberos_Login/no-token (0.00s)
=== RUN   TestAuthLoginOCI_Init
=== RUN   TestAuthLoginOCI_Init/basic
=== RUN   TestAuthLoginOCI_Init/error-missing-resource
=== RUN   TestAuthLoginOCI_Init/error-missing-required
--- PASS: TestAuthLoginOCI_Init (0.00s)
    --- PASS: TestAuthLoginOCI_Init/basic (0.00s)
    --- PASS: TestAuthLoginOCI_Init/error-missing-resource (0.00s)
    --- PASS: TestAuthLoginOCI_Init/error-missing-required (0.00s)
=== RUN   TestAuthLoginOCI_LoginPath
=== RUN   TestAuthLoginOCI_LoginPath/default
--- PASS: TestAuthLoginOCI_LoginPath (0.00s)
    --- PASS: TestAuthLoginOCI_LoginPath/default (0.00s)
=== RUN   TestAuthLoginOCI_Login
=== RUN   TestAuthLoginOCI_Login/api-keys
    auth_oci_test.go:192: "TF_ACC_OCI_AUTH" must be set
=== RUN   TestAuthLoginOCI_Login/error-uninitialized
--- PASS: TestAuthLoginOCI_Login (0.00s)
    --- SKIP: TestAuthLoginOCI_Login/api-keys (0.00s)
    --- PASS: TestAuthLoginOCI_Login/error-uninitialized (0.00s)
=== RUN   TestAuthLoginOIDC_Init
=== RUN   TestAuthLoginOIDC_Init/basic
=== RUN   TestAuthLoginOIDC_Init/error-missing-resource
=== RUN   TestAuthLoginOIDC_Init/error-missing-required
--- PASS: TestAuthLoginOIDC_Init (0.00s)
    --- PASS: TestAuthLoginOIDC_Init/basic (0.00s)
    --- PASS: TestAuthLoginOIDC_Init/error-missing-resource (0.00s)
    --- PASS: TestAuthLoginOIDC_Init/error-missing-required (0.00s)
=== RUN   TestAuthLoginOIDC_LoginPath
=== RUN   TestAuthLoginOIDC_LoginPath/default
--- PASS: TestAuthLoginOIDC_LoginPath (0.00s)
    --- PASS: TestAuthLoginOIDC_LoginPath/default (0.00s)
=== RUN   TestAuthLoginOIDC_getAuthParams
=== RUN   TestAuthLoginOIDC_getAuthParams/listener-addr-only
=== RUN   TestAuthLoginOIDC_getAuthParams/callback-addr-only
=== RUN   TestAuthLoginOIDC_getAuthParams/both-addrs
=== RUN   TestAuthLoginOIDC_getAuthParams/error-no-role
--- PASS: TestAuthLoginOIDC_getAuthParams (0.00s)
    --- PASS: TestAuthLoginOIDC_getAuthParams/listener-addr-only (0.00s)
    --- PASS: TestAuthLoginOIDC_getAuthParams/callback-addr-only (0.00s)
    --- PASS: TestAuthLoginOIDC_getAuthParams/both-addrs (0.00s)
    --- PASS: TestAuthLoginOIDC_getAuthParams/error-no-role (0.00s)
=== RUN   TestAuthLoginOIDC_Login
=== RUN   TestAuthLoginOIDC_Login/error-uninitialized
--- PASS: TestAuthLoginOIDC_Login (0.00s)
    --- PASS: TestAuthLoginOIDC_Login/error-uninitialized (0.00s)
=== RUN   TestAuthLoginRadius_Init
=== RUN   TestAuthLoginRadius_Init/basic
=== RUN   TestAuthLoginRadius_Init/error-missing-resource
=== RUN   TestAuthLoginRadius_Init/error-missing-required
--- PASS: TestAuthLoginRadius_Init (0.00s)
    --- PASS: TestAuthLoginRadius_Init/basic (0.00s)
    --- PASS: TestAuthLoginRadius_Init/error-missing-resource (0.00s)
    --- PASS: TestAuthLoginRadius_Init/error-missing-required (0.00s)
=== RUN   TestAuthLoginRadius_LoginPath
=== RUN   TestAuthLoginRadius_LoginPath/default
--- PASS: TestAuthLoginRadius_LoginPath (0.00s)
    --- PASS: TestAuthLoginRadius_LoginPath/default (0.00s)
=== RUN   TestAuthLoginRadius_Login
=== RUN   TestAuthLoginRadius_Login/basic
=== RUN   TestAuthLoginRadius_Login/error-uninitialized
--- PASS: TestAuthLoginRadius_Login (0.00s)
    --- PASS: TestAuthLoginRadius_Login/basic (0.00s)
    --- PASS: TestAuthLoginRadius_Login/error-uninitialized (0.00s)
=== RUN   TestAuthLoginUserpass_LoginPath
=== RUN   TestAuthLoginUserpass_LoginPath/basic
--- PASS: TestAuthLoginUserpass_LoginPath (0.00s)
    --- PASS: TestAuthLoginUserpass_LoginPath/basic (0.00s)
=== RUN   TestAuthLoginUserpass_Login
=== RUN   TestAuthLoginUserpass_Login/basic
=== RUN   TestAuthLoginUserpass_Login/error-no-username
=== RUN   TestAuthLoginUserpass_Login/error-uninitialized
--- PASS: TestAuthLoginUserpass_Login (0.00s)
    --- PASS: TestAuthLoginUserpass_Login/basic (0.00s)
    --- PASS: TestAuthLoginUserpass_Login/error-no-username (0.00s)
    --- PASS: TestAuthLoginUserpass_Login/error-uninitialized (0.00s)
PASS

Copy link
Contributor

@vinay-gopalan vinay-gopalan left a comment

Choose a reason for hiding this comment

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

Looks great!

@benashz benashz merged commit 09b362e into main Oct 11, 2022
@benashz benashz deleted the VAULT-9219/update-login-tests-oidc-et-al branch October 11, 2022 21:00
@benashz benashz added this to the 3.10.0 milestone Oct 11, 2022
marcboudreau pushed a commit to marcboudreau/terraform-provider-vault that referenced this pull request Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants