zorkian / go-datadog-api

A Go implementation of the Datadog API.
BSD 3-Clause "New" or "Revised" License
183 stars 156 forks source link

Roles support #313

Closed bkimbrough88 closed 3 years ago

bkimbrough88 commented 4 years ago

Enabling the SDK to perform CRUD operations on Roles as well as manage permissions and users on those roles.

Fixes: #307

sendqueery commented 4 years ago

This looks good, but appears to be missing support for scoping unless I've missed something? It looks like it's missing from the API docs, but is mentioned elsewhere in Datadog's docs: https://docs.datadoghq.com/account_management/faq/managing-global-role-permissions/?tab=datadogussite#granting-permissions-within-limited-scopes

From their example:

{
    "data": {
        "type": "permissions",
         "id": <PERMISSION_UUID>,
         "scope": {
             "indexes": [
                 "main",
                 "support"
            ]
        }
    }
}
bkimbrough88 commented 4 years ago

You're right, I've added permission scope to the grant permission requests

bkimbrough88 commented 4 years ago

I worry that it is a bit early for the role permission API to be solidified in the public client. Can we postpone implementing this API while we roadmap the APIs definition internally. Roles Users and Permissions are good to go.

I feel like anything posted in https://docs.datadoghq.com/api should be stable enough to write into an SDK. The caveat being that you then have to maintain that feature in the SDK as the API evolves.

bkimbrough88 commented 4 years ago

Apologies on letting this sit, I'll take care of the PR comments later tonight