auth: support multiple AUTHORIZATION_TOKEN in single message - #552
Conversation
0920918 to
138350f
Compare
|
I found two blocking authorization-contract issues. [IMPORTANT] Invalid tokens must not be dropped when another credential permits the operation. [IMPORTANT] A request token no longer overrides the session grants. For verification, exact head |
|
@mondain I am lost at what reaction/action do you expect from me? Both of those findings work as I intended, at least what I can parse from your text, do you disagree with my intention or are you raising a question if this was the intention? |
afrind
left a comment
There was a problem hiding this comment.
The linked WG issue #1838 is still open and explicitly identifies this conflict, so the current draft behavior should remain authoritative until that discussion changes it.
eh, I think we have operational flexibility here, especially if we think it's going to trend towards this interpretation.
A request token no longer overrides the session grants.
As long as the docs are updated to match, I think this is also within our power to define. I think "SETUP tokens are the base set, requests extend privileges" makes sense. Obviously the caller has the SETUP token so they could have included it in the request if they wanted to.
@afrind reviewed 6 files and all commit messages, and made 3 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on michalhosna).
src/auth/Auth.h line 131 at r1 (raw file):
// Verifies the setup AUTHORIZATION_TOKEN(s). Returns a null pointer when auth // is disabled; otherwise a shared vector of every successfully-verified
why shared and not unique_ptr?
src/auth/Auth.cpp line 182 at r1 (raw file):
} folly::Expected<std::shared_ptr<const std::vector<Grants>>, AuthError>
I guess I missed before that this is shared_ptr - can it be unique?
michalhosna
left a comment
There was a problem hiding this comment.
@michalhosna made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on afrind).
src/auth/Auth.h line 131 at r1 (raw file):
Previously, afrind wrote…
why shared and not unique_ptr?
It's passed down to AuthPublisherFilter and AuthSubscriberFilter.
AFAIK the Filter's lifetime is decoupled from Sessions's lifetime, so making it owned by the session is not safe as the filter may outlive it in coroutine.
And I don't feel like single shared_ptr copy at session initialization is worth optimizing.
afrind
left a comment
There was a problem hiding this comment.
@afrind made 1 comment and resolved 1 discussion.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on michalhosna).
src/auth/Auth.h line 131 at r1 (raw file):
Previously, michalhosna (Michal Hošna) wrote…
It's passed down to
AuthPublisherFilterandAuthSubscriberFilter.AFAIK the Filter's lifetime is decoupled from Sessions's lifetime, so making it owned by the session is not safe as the filter may outlive it in coroutine.
And I don't feel like single shared_ptr copy at session initialization is worth optimizing.
I think it's less about optimization and more about making it easier to reason about things that have only a single owner. But I won't lie down in the road here.
afrind
left a comment
There was a problem hiding this comment.
@afrind resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on michalhosna).
A token that fails to verify is dropped as a non-viable candidate. The most specific verification error surfaces when nothing in the pool works. Related: - moq-wg/moq-transport#1838 - Semantics of multiple AUTHORIZATION TOKEN parameters in one message - moq-wg/moq-transport#1724 - Which token caused the error
138350f to
29ae631
Compare
Preparation for #530
Related:
This change is