TritonDataCenter / TritonDataCenter/sdc-cloudapi
RBAC: Cannot set `role-tag` on `/my/config`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 8
- Forks
- 22
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 1
Description
I'm not able to use HTTP PUT to update the role-tag on /my/config.
Reproduction setup, the usual environment variables and also:
function cloudapi() {
local now=$(date -u '+%a, %d %h %Y %H:%M:%S GMT')
local signature=$(echo -n "$now" | openssl dgst -sha256 -sign ~/.ssh/id_rsa | openssl enc -e -a | tr -d '\n')
local url="$SDC_URL$1"
shift
curl --silent --insecure \
--header 'Accept: application/json' \
--header "accept-version: ~8" \
--header "Date: $now" \
--header "Authorization: Signature keyId=\"/$SDC_ACCOUNT/keys/id_rsa\",algorithm=\"rsa-sha256\" $signature" \
"$@" "$url"
echo
}
Make sure keyId matches your account's key name. You may need to create an example role too.
Expected output:
$ cloudapi /my/config --request PUT --header "Content-Type: application/json" --data '{"role-tag": ["network-operator"]}'
{"name":"/$SDC_ACCOUNT/config","role-tag":["network-operator"]}
Actual output:
$ cloudapi /my/config --request PUT --header "Content-Type: application/json" --data '{"role-tag": ["network-operator"]}'
{"code":"InvalidArgument","message":"property \"default_network\": is missing and it is required"}
This server is CloudAPI version 9.3.0, apologies if this is already fixed in a newer version.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the HTTP PUT request against /my/config with only role-tag, then inspect the configuration update entry point and its validation of default_network. Done means the request returns the updated configuration with role-tag instead of reporting that default_network is missing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100