You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a developer of a web service, I would like to control authorization on operation instead of API level, so that I do not need to handle the authorization within the operation and can simpliy annotate my methods.
Example
publicclassMyService{[ResourceMethod][RequireAdmin]public IResponse AdminOnly(){ ...}}publicclassRequireAdminAttribute:AuthorizeByAttribute<AdminAuthorization>{}publicclassAdminAuthorization:IAuthorizationRule{publicValueTask<bool>Authorize(IRequestrequest,OperationArgumentsarguments){// somehow include the attribute valuesreturntrue;// maybe a more complex type, e.g. AuthorizationResult with Result features}}
Acceptance criteria
The feature can be used on all frameworks
Authorization logic can easily fetch arguments passed to the operation by the client (typed)
Authorization logic can fetch arguments passed to the attribute
Authorization logic can return details to the client when access is denied (serialized in a default way)
The feature is documented on the GenHTTP website
The feature is covered by acceptance tests
The text was updated successfully, but these errors were encountered:
As a developer of a web service, I would like to control authorization on operation instead of API level, so that I do not need to handle the authorization within the operation and can simpliy annotate my methods.
Example
Acceptance criteria
The text was updated successfully, but these errors were encountered: