Open thovoll opened 3 years ago
The requirement of being the last policy only applies to authorization polices based on HMAC (like CosmosDB, or Azure Storage). Other mechanisms, like the Bearer Token, can be inserted elsewhere (maybe it must be per retry if we want to handle the refresh token automatically).
For this reason I believe that it's right to have the Pipeline
struct in core
free of constraints. That said, I agree with you, we should make the pipeline creation as error-proof as possible.
See this comment: https://github.com/Azure/azure-sdk-for-rust/blob/c6f94bcd494e74dc71977136fa62362d0b8f6fbf/sdk/cosmos/src/clients/cosmos_client.rs#L74
Having to remember this and replicate this comment to all code that creates a new pipeline is not great.
How can we remove this order dependency?
Maybe introduce a separate pipeline parameter for auth policy?