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

Fix resource access requests for apps #13955

Merged
merged 8 commits into from
Jun 30, 2022
Merged

Conversation

nklaassen
Copy link
Contributor

Resource access requests for apps are currently broken for static apps because I incorrectly assumed they would be returned from calls to GetApp, which is not the case.

The change here is to use ListResources instead of GetApp, GetNode, etc... in PruneResourceRequestRoles. This is more consistent with the way we search for resources and build the access request in the first place with tsh request search and from the web UI, where ListResources is already used.

@github-actions github-actions bot requested review from jakule and ravicious June 29, 2022 00:14
@github-actions github-actions bot added the tsh tsh - Teleport's command line tool for logging into nodes running Teleport. label Jun 29, 2022
lib/services/access_request.go Show resolved Hide resolved
lib/services/access_request.go Outdated Show resolved Hide resolved
lib/services/access_request.go Outdated Show resolved Hide resolved
lib/services/access_request.go Outdated Show resolved Hide resolved
lib/services/access_request.go Show resolved Hide resolved

// namesMatcher returns a PredicateExpression which matches any of a given list
// of names. Given names will be escaped and quoted when building the expression.
func namesMatcher(names []string) string {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I'd change the name to namesOrMatcher to indicate that the final expression uses the || operator. Feel free to leave as it is if you think that the comment is enough.

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 with anyNameMatcher so it doesn't sound like it might return some names OR a matcher 🤷‍♂️

@nklaassen nklaassen enabled auto-merge (squash) June 30, 2022 18:17
@nklaassen nklaassen merged commit 9ca9082 into master Jun 30, 2022
@github-actions
Copy link

@nklaassen See the table below for backport results.

Branch Result
branch/v10 Create PR

@nklaassen nklaassen deleted the nklaassen/resource-request-apps branch June 30, 2022 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tsh tsh - Teleport's command line tool for logging into nodes running Teleport.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants