Skip to content

Add a concept of a caveat TypeSet to allow overriding the types available to caveat processing #2315

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

Merged
merged 1 commit into from
Apr 16, 2025

Conversation

josephschorr
Copy link
Member

No description provided.

@github-actions github-actions bot added area/api v0 Affects the v0 API area/CLI Affects the command line area/schema Affects the Schema Language area/api v1 Affects the v1 API area/datastore Affects the storage system area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) area/dispatch Affects dispatching of requests labels Apr 9, 2025
Copy link
Contributor

@barakmich barakmich left a comment

Choose a reason for hiding this comment

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

I like the fact it's all piped through! But then it immediately reads to me as though there's a config struct waiting to happen for the params to some of the NewX functions, specifically in internal/dispatch/graph/graph.go and internal/graph/lookupresources2.go (and maybe internal/services/v1/schema.go)

@josephschorr josephschorr marked this pull request as ready for review April 14, 2025 14:44
@josephschorr josephschorr requested a review from a team as a code owner April 14, 2025 14:44
@josephschorr
Copy link
Member Author

I like the fact it's all piped through! But then it immediately reads to me as though there's a config struct waiting to happen for the params to some of the NewX functions, specifically in internal/dispatch/graph/graph.go and internal/graph/lookupresources2.go (and maybe internal/services/v1/schema.go)

Almost certainly. Do you think we should do it now or as a followup?

@barakmich
Copy link
Contributor

I like the fact it's all piped through! But then it immediately reads to me as though there's a config struct waiting to happen for the params to some of the NewX functions, specifically in internal/dispatch/graph/graph.go and internal/graph/lookupresources2.go (and maybe internal/services/v1/schema.go)

Almost certainly. Do you think we should do it now or as a followup?

Might as well; easy enough to find the locations since it follows this diff

tstirrat15
tstirrat15 previously approved these changes Apr 16, 2025
Copy link
Contributor

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

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

LGTM, pending removal of the zip and a question

Copy link
Contributor

Choose a reason for hiding this comment

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

Unintentional?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep

Comment on lines +29 to +32
// Freeze marks the TypeSet as frozen. A frozen TypeSet cannot be modified.
func (ts *TypeSet) Freeze() {
ts.isFrozen = true
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a convention? Where does this actually prevent the TypeSet from being modified?

Copy link
Member Author

Choose a reason for hiding this comment

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

Check below: it can't be used if not frozen

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, it can't be used, but nothing prevents me from touching a frozen typeset (unless I'm missing something)

tstirrat15
tstirrat15 previously approved these changes Apr 16, 2025
Copy link
Contributor

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@barakmich barakmich left a comment

Choose a reason for hiding this comment

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

Boy howdy that's a lot of files. Fortunately, mostly signature-driven.

LGTM

@josephschorr josephschorr enabled auto-merge April 16, 2025 19:27
@josephschorr josephschorr added this pull request to the merge queue Apr 16, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 16, 2025
@josephschorr josephschorr added this pull request to the merge queue Apr 16, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 16, 2025
@josephschorr josephschorr added this pull request to the merge queue Apr 16, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 16, 2025
@josephschorr josephschorr added this pull request to the merge queue Apr 16, 2025
Merged via the queue into authzed:main with commit 6690e3f Apr 16, 2025
41 checks passed
@josephschorr josephschorr deleted the caveat-type-set branch April 16, 2025 20:20
@github-actions github-actions bot locked and limited conversation to collaborators Apr 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/api v0 Affects the v0 API area/api v1 Affects the v1 API area/CLI Affects the command line area/datastore Affects the storage system area/dispatch Affects dispatching of requests area/schema Affects the Schema Language area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants