Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

fix: retrieving state outputs only requires read role #603

Merged
merged 5 commits into from
Sep 13, 2023

Conversation

leg100
Copy link
Owner

@leg100 leg100 commented Sep 13, 2023

Fixes #601.

Retrieving the current state outputs should not require organization ownership, only a read role on the workspace or a workspace admin role. This PR addresses that.

Also refactors the output retrieval code: instead of retrieving each output one by one, all outputs are retrieved at once.

@@ -27,6 +27,6 @@ func (a *authorizer) CanAccess(ctx context.Context, action rbac.Action, workspac
if subj.CanAccessWorkspace(action, policy) {
return subj, nil
}
a.Error(nil, "unauthorized action", "workspace_id", workspaceID, "organization", policy.Organization, "action", action, "subject", subj)
a.Error(nil, "unauthorized action", "workspace_id", workspaceID, "organization", policy.Organization, "action", action.String(), "subject", subj)
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you, action = 80 wasn't very informative.

@leg100
Copy link
Owner Author

leg100 commented Sep 13, 2023 via email

@leg100 leg100 merged commit 25c4a99 into master Sep 13, 2023
5 checks passed
leg100 pushed a commit that referenced this pull request Sep 13, 2023
🤖 I have created a release *beep* *boop*
---


## [0.1.13](v0.1.12...v0.1.13)
(2023-09-13)


### Features

* add flags --oidc-username-claim and --oidc-scopes
([#605](#605))
([87324d0](87324d0)),
closes [#596](#596)


### Bug Fixes

* restart spooler when broker terminates subscription
([#600](#600))
([ce41580](ce41580))
* retrieving state outputs only requires read role
([#603](#603))
([25c4a99](25c4a99))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@leg100 leg100 deleted the refactor-state-tfe-api-includes branch December 16, 2023 10:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: ReadCurrentWithOptions semantics changed
2 participants