Skip to content

Feature: Auth Interceptor: Add support for partial per service AuthFunc override #707

Open
@seinshah

Description

@seinshah

Sometimes, there is a possibility that some of the methods in a service are publicly available and some need authentication.
The current ServiceAuthFuncOverride allows each service to override the global AuthFunc. However, if a service needs to override the global AuthFunc for some methods, it needs to duplicate AuthFunc logic.
It would be nice to allow services to override AuthFunc, but also allow them to fallback to the global AuthFunc if they want to only override it for certain methods and not all of them.

Activity

johanbrandhorst

johanbrandhorst commented on Apr 25, 2024

@johanbrandhorst
Collaborator

Thanks for your issue. For this sort of thing I usually recommend just forking the repo and implementing what you need. I'm opposed to functionality bloat because it can spiral out of control quickly. Even just copy pasting the handler logic you need (preserving the license, of course) is not that big of a deal.

seinshah

seinshah commented on Apr 26, 2024

@seinshah
Author

@johanbrandhorst, that's kind of what I did and diverged from this repo to address the need. However, as you mentioned, if this is not something people face very often, it might not worth being added to the source code.
Thanks for your comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Participants

    @seinshah@johanbrandhorst

    Issue actions

      Feature: Auth Interceptor: Add support for partial per service AuthFunc override · Issue #707 · grpc-ecosystem/go-grpc-middleware