Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify if/how enduser.role can have multiple roles #307

Conversation

swar8080
Copy link

@swar8080 swar8080 commented Sep 9, 2023

Changes

Some role-based access control implementations allow assuming multiple roles. For example, in Java's Spring Security framework

Let me know if it makes sense to clarify that multiple roles are possible in the enduser.role attribute documentation

I noticed this when looking at a request to capture enduser.role with spring security auto-instrumentation (open-telemetry/opentelemetry-java-instrumentation#9400)

Merge requirement checklist

@swar8080 swar8080 requested review from a team September 9, 2023 22:12
@@ -320,7 +320,7 @@ These attributes may be used for any operation with an authenticated and/or auth
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `enduser.id` | string | Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. | `username` | Recommended |
| `enduser.role` | string | Actual/assumed role the client is making the request under extracted from token or application security context. | `admin` | Recommended |
| `enduser.role` | string | Actual/assumed role(s) the client is making the request under extracted from token or application security context. | `admin, superadmin` | Recommended |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another option is to change it to enduser.roles and define it as string[]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that'd be clearer. enduser.scope could also be pluralized and changed to string[]

Do you know off-hand if this change can/should have a transformation in schema-next.yaml? I don't see other examples of a rename that also goes from string -> string[], and didn't see the schema documentation mention if/how data type changes are handled

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the schema transformation processor and will take a look at how this scenario's handled

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the processor just renames the attribute - no transformation to the value's done

lmk if the breaking change to string[] makes sense

@AlexanderWert
Copy link
Member

In ECS, there's the user.* namespace. So, when changing enduser.* attributes we should discuss alignment with ECS in general.

Regarding roles: In ECS the corresponding field is user.roles, so an array-type field as well.

Copy link

github-actions bot commented Feb 3, 2024

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Feb 3, 2024
@joaopgrassi
Copy link
Member

Hi @swar8080 !

We changed how the CHANGELOG.md is managed. Please take a look at https://github.com/open-telemetry/semantic-conventions/blob/main/CONTRIBUTING.md#adding-a-changelog-entry to see what needs to be done. Sorry for the disruption.

@github-actions github-actions bot removed the Stale label Feb 14, 2024
Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Feb 29, 2024
Copy link

github-actions bot commented Mar 8, 2024

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Mar 8, 2024
@trask
Copy link
Member

trask commented Apr 23, 2024

this should be addressed by #731, which deprecates enduser.role in favor of user.roles which is an array

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants