Skip to content

Conversation

@boxofrad
Copy link
Contributor

See: RFD 0029e

@boxofrad boxofrad added machine-id no-changelog Indicates that a PR does not require a changelog entry delegated-access labels Oct 15, 2025
Comment on lines +48 to +51
// Resources that will be accessible in sessions created using this profile.
//
// In the Resource ID format: /<cluster>/<kind>/<name>/<sub resource name>
repeated string required_resources = 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went for the string representation here instead of types.ResourceID to make the YAML representation more easily editable.

Not sure if there's a better way to do that? Maybe at the marshal/unmarshal function level?

Copy link
Contributor

Choose a reason for hiding this comment

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

Overriding the marshal/unmarshal for proto generated structs feels like a bit of an anti-pattern - we've definitely had some issues with that before.

Copy link
Contributor

@greedy52 greedy52 Oct 15, 2025

Choose a reason for hiding this comment

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

FYI, we are likely moving away from the old resource id to this new json format:
https://github.com/gravitational/teleport/pull/59288/files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the heads-up, @greedy52! The JSON-based format discussed in that RFD isn't very human-writable either, but they're apparently changing tack and the old slash-delimited format will keep working (see: #59288 (comment)).

Copy link
Contributor

@greedy52 greedy52 Oct 17, 2025

Choose a reason for hiding this comment

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

thanks. mcp-tools can be set as constraints tho, similar to logins, db_users

(sorry for carrying that discussion here. i didn't know about constraints stuff when reviewing the delegation RFD).

Copy link
Contributor

Choose a reason for hiding this comment

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

just to throw in my 2 cents, using the serialized /<cluster>/<kind>/<name> string path format here feels like a potential foot-gun w/r/t forwards-compatibility...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm, okay maybe it's worth having our own user-facing representation that "compiles down" to AllowedResourceIDs or ConstrainedResourceID?

Something like:

required_resources:
  - kind: mcp
    name: github
    tools: [merge_pull_request]

Copy link
Contributor

Choose a reason for hiding this comment

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

i like the idea. it is more user-friendly than reusing ConstrainedResourceID but downside you have to maintain this separately. one small nit maybe mcp_tools instead of tools? like

required_resources:
  - kind: mcp
    name: github
    mcp_tools: [merge_pull_request]
  - kind: db
    name: postgres
    db_users: [teleport-admin]
    db_names: [sales]

Copy link
Contributor

@strideynet strideynet left a comment

Choose a reason for hiding this comment

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

Approved pending final RFD approvals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated-access machine-id no-changelog Indicates that a PR does not require a changelog entry size/sm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants