Skip to content

Conversation

mohamedhabas11
Copy link

attempt at looking up secret-id by meta data

#31551

@mohamedhabas11 mohamedhabas11 requested a review from a team as a code owner September 27, 2025 16:49
Copy link

vercel bot commented Sep 27, 2025

@mohamedhabas11 is attempting to deploy a commit to the HashiCorp Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

hashicorp-cla-app bot commented Sep 27, 2025

CLA assistant check
All committers have signed the CLA.

@mohamedhabas11
Copy link
Author

for context
this is the result of querying the endpoint after suggested changes.

./bin/vault auth enable approle
Success! Enabled approle auth method at: approle/
./bin/vault write auth/approle/role/testrole \
        secret_id_ttl=60m \
        token_ttl=60m \
        token_max_ttl=120m
Success! Data written to: auth/approle/role/testrole
./bin/vault write -f auth/approle/role/testrole/secret-id metadata="alias=web1,cidr=192.168.15.15/24"
Key                   Value
---                   -----
secret_id             2faf70d3-70ec-ce6c-f3b5-f6926072bc3f
secret_id_accessor    df8fbd5f-2976-9f72-d3f0-600228a7ca87
secret_id_num_uses    0
secret_id_ttl         1h
curl -s \
      --header "X-Vault-Token: $VAULT_TOKEN" \
      "$VAULT_ADDR/v1/auth/approle/role/testrole/secret-id/lookup-by-metadata?cidr=192.168.15.15"
{"request_id":"f0912110-5458-cffc-f5c6-c56e2bd97365","lease_id":"","renewable":false,"lease_duration":0,"data":{"keys":["df8fbd5f-2976-9f72-d3f0-600228a7ca87"]},"wrap_info":null,"warnings":null,"auth":null,"mount_type":"approle"}
curl -s \
      --header "X-Vault-Token: $VAULT_TOKEN" \
      "$VAULT_ADDR/v1/auth/approle/role/testrole/secret-id/lookup-by-metadata?alias=web1"
{"request_id":"fcfe401e-56e7-a5cc-2cff-186d8f2a425c","lease_id":"","renewable":false,"lease_duration":0,"data":{"keys":["df8fbd5f-2976-9f72-d3f0-600228a7ca87"]},"wrap_info":null,"warnings":null,"auth":null,"mount_type":"approle"}

@heatherezell
Copy link
Contributor

Thanks for this! Please don't forget to sign the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants