mongodb-atlas-cli
mongodb-atlas-cli copied to clipboard
POC: SDK based authentication
trafficstars
Description
Integration with Credentials module in Atlas CLI
WIP - Intention is to provide demo for authentication capability implemented by my team. PR is not usable and will not be merged.
Testing
- Create profile
/bin/atlas config edit --profile auth-test --debug
[auth-test]
output = 'json'
ops_manager_url = 'https://cloud-dev.mongodb.com'
org_id = '6707a96bc2b066602a4dfdcc'
project_id = '670ce177f33cea212ea202a5'
public_api_key = 'your sa id'
private_api_key = 'your sa secret'
or setup profile using cli
/bin/atlas config init --profile auth-test
? Service Account Client ID: ****************
? Service Account Secret: [? for help] ************************
😘
- Run API call (command)
./bin/atlas clusters list --profile auth-test --debug
Result:
{"links":[{"href":"https://cloud-dev.mongodb.com/api/atlas/v2/groups/670ce177f33cea212ea202a5/clusters?includeCount=true&includeDeletedWithRetainedBackups=false&pageNum=1&itemsPerPage=100","rel":"self"}],"results":[],"totalCount":0}
{
"links": [
{
"href": "https://cloud-dev.mongodb.com/api/atlas/v2/groups/670ce177f33cea212ea202a5/clusters?includeCount=true\u0026includeDeletedWithRetainedBackups=false\u0026pageNum=1\u0026itemsPerPage=100",
"rel": "self"
}
],
"results": [],
"totalCount": 0
}
- Run API call (command)
./bin/atlas clusters setup --profile auth-test --debug
//TODO