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

Prototype: StructuredAccessControl.anyOf #63

Closed

Conversation

josh-newman
Copy link
Contributor

@saeta

I've been looking at HeaderAccessControl for a while, and I still find the testing method strange. As we chatted about before, it's forcing access controls to maintain some authenticator/authorizer separation, but letting the boundary be hidden.

This seems bad because:

  • Combinators now duplicate some logic between their run and their check (like how they aggregate individual results in anyOf, etc.).
  • I'd like to make access control covariant in the authentication type, because run produces the authentication result so it seems natural (and it'd allow more convenient manipulation in our more complex internal access controls), but the internal-for-testing-only check makes this impossible. This makes the abstraction leaky.
  • It forgoes the readability and implementation guidance that StructuredAccessControl provides (by constraining what's possible and naming things nicely).

This PR contains a prototype (not suitable for merging) of how the combinators could be defined on StructuredAccessControls. The Scaladoc makes a claim about why this implementation is ok; I'm happy to discuss. If we can agree on this, I want to remove the generic HeaderAccessControl entirely and move that name to StructuredAccessControl, thus forcing all our access controls to have that nice structure.

@josh-newman josh-newman closed this Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant