mirror of
https://github.com/hashicorp/vault-plugin-auth-oci
synced 2026-07-22 13:33:43 +00:00
No description
- Go 85%
- HCL 9.5%
- Shell 3.1%
- Makefile 2.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
* fix(oci-auth): use realm-aware endpoint resolution for non-oc1 regions
AuthenticationClient.SetRegion() was building the auth host with
fmt.Sprintf(common.DefaultHostURLTemplate, ...), which always produces
an oraclecloud.com endpoint. Regions in non-oc1 realms require a
different TLD (e.g. oraclecloud21.com for oc21/Doha,
oraclecloud14.com for oc14/EU-DCC).
Replace both usages with:
common.StringToRegion(region).EndpointForTemplate(
"auth", "https://auth.{region}.{secondLevelDomain}")
EndpointForTemplate delegates second-level domain resolution to the
OCI SDK's built-in realm registry, which already carries the full
realm-to-domain mapping. The OCI_SDK_AUTH_CLIENT_REGION_URL env var
override is preserved with unchanged behaviour.
Add authentication_client_test.go covering one representative region
per OCI realm (14 realms) to pin the correct endpoint for each, and
guard against regression.
Fixes VAULT-39812
* docs: improve comments in setConfigurationProvider
* docs: address PR review comments and add changelog entry
- Fix duplicate comment in backend.go: second "Create the instance
principal provider" label now correctly reads "Create the
authentication client using the instance principal provider"
- Fix inaccurate doc comment in authentication_client_test.go: remove
"one representative region from each OCI realm" since oc14 has
multiple entries
- Add CHANGELOG entry for v0.22.0 (VAULT-39812 fix, PR #106)
* test: narrow realm endpoint test to regression cases only
Remove 12 hard-coded realm/host expectations that were testing OCI SDK
internal registry data rather than plugin behaviour. Keep one oc1 case
(us-ashburn-1) to confirm existing regions are unaffected and one oc21
case (me-dcc-doha-1) as the direct regression guard for VAULT-39812.
* docs: move changelog entry to Unreleased per review feedback
|
||
| .github | ||
| cmd/vault-plugin-auth-oci | ||
| scripts | ||
| tests/terraform | ||
| .gitignore | ||
| .go-version | ||
| authenticate_client_details.go | ||
| authenticate_client_request_response.go | ||
| authenticate_client_result.go | ||
| authentication_client.go | ||
| authentication_client_test.go | ||
| backend.go | ||
| backend_test.go | ||
| CHANGELOG.md | ||
| cli.go | ||
| CODEOWNERS | ||
| filter_group_membership_details.go | ||
| filter_group_membership_request_response.go | ||
| filter_group_membership_result.go | ||
| go.mod | ||
| go.sum | ||
| internal_claims.go | ||
| LICENSE | ||
| Makefile | ||
| oci_client.go | ||
| path_config.go | ||
| path_config_test.go | ||
| path_login.go | ||
| path_login_test.go | ||
| path_role.go | ||
| path_role_test.go | ||
| principal.go | ||
| README.md | ||
| slice_helper.go | ||
Vault Plugin Auth OCI
Vault auth plugin for Oracle Cloud Infrastructure.
Acceptance tests
The acceptance tests can only be run from an OCI instance.
If you are running this code on an OCI instance, you can run them directly with make testacc.
You will need to set the following environtment variables:
HOME_TENANCY_IDto the tenancy you are running under (or your root tenancy ID)ROLE_OCID_LISTto a comma-separated list of group OCIDs to at least two groups. At least one should be a dynamic group that contains the instance, and another should be an identity group that contains your user.
For example:
make testacc HOME_TENANCY_ID=ocid1.tenancy.oc1..aaaaaaaasomecharacter ROLE_OCID_LIST=ocid1.group.oc1..aaaaaaaasomecharacters OCI_GO_SDK_DEBUG=info VAULT_LOG_LEVEL=debug
Terraform
You can run the acceptance tests with terraform as well.
You will need an OCI account.
You need to generate and download a private key in your account settings. This should give you a private key file, the fingerprint, your tenancy OCID, and your user OCID.
Using those, you can run the acceptance tests via:
cd tests/terraform
# download your private key to this directory
terraform init
terraform apply \
-var "fingerprint=YOURFINGERPRINT" \
-var "tenancy_ocid=YOUR_TENANCY_OCID" \
-var "user_ocid=YOUR_USER_OCID" \
-var "private_key_path=YOUR_PRIVATE_KEY" \
-var "region=YOUR_REGION"
This downloads the current main branch from GitHub and runs the tests on an OCI instance.
It takes about 5 minutes.
Don't forget to destroy the resources when you are done:
terraform destroy \
-var "fingerprint=YOURFINGERPRINT" \
-var "tenancy_ocid=YOUR_TENANCY_OCID" \
-var "user_ocid=YOUR_USER_OCID" \
-var "private_key_path=YOUR_PRIVATE_KEY" \
-var "region=YOUR_REGION"