Steven Clark ab75d03a6c
Add new /sys/well-known interface to get information about registered labels (#25695)
* Add new /sys/well-known interface to get information about registered labels

 - Add two new interfaces LIST/GET /sys/well-known which will provide
   a list of keys which are registered labels within the /.well-known space on
   the local server, along with a detailed info map for each
 - Add GET /sys/well-known/<label> to get details on a specific registered label
 - Add docs and tests for the new api endpoints

* Add test doc and remove copied comment

* Rename returned fields to use snake case

* Remove extra newline added when resolving the merge conflict

* Apply suggestions from code review

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>

---------

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
2024-02-29 17:07:49 -05:00

75 lines
1.5 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
layout: api
page_title: /sys/well-known - HTTP API
description: The `/sys/well-known` endpoint is used to list and read registered .well-known labels in Vault.
---
# `/sys/well-known`
Use the `/sys/well-known` endpoint to list and read registered labels on the `.well-known/` path prefix for your Vault instance.
## List well-known
List all registered labels.
| Method | Path |
|:-------|:------------------|
| `GET` | `/sys/well-known` |
| `LIST` | `/sys/well-known` |
### Sample request
```shell-session
$ curl \
--header "X-Vault-Token: ..." \
http://127.0.0.1:8200/v1/sys/well-known
```
### Sample response
```json
{
"key_info": {
"est/cacerts": {
"mount_path": "ns1/pki_int/",
"mount_uuid": "fc9d3ee4-ae92-4e3e-c0e1-a1fdb3e3b8cf",
"prefix": "est/cacerts"
}
},
"keys": [
"est/cacerts"
]
}
```
## Read well-known
Retrieve information for the specified label.
| Method | Path |
| :----- |:-------------------------|
| `GET` | `/sys/well-known/:label` |
### Parameters
- `label` `(string: <required>)`  URL path parameter specifying the registered label to fetch.
### Sample request
```shell-session
$ curl \
--header "X-Vault-Token: ..." \
http://127.0.0.1:8200/v1/sys/well-known/est/cacerts
```
### Sample response
```json
{
"label": "est/cacerts",
"mount_path": "ns1/pki_int/",
"mount_uuid": "fc9d3ee4-ae92-4e3e-c0e1-a1fdb3e3b8cf",
"prefix": "est/cacerts"
}
```