breaking change: auth options now takes fully qualified method names

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
2022-07-16 19:03:44 +02:00
parent 4de0ec6a3b
commit 9729fb8b8a
3 changed files with 8 additions and 14 deletions

View File

@ -6,12 +6,14 @@ import (
type Option func(o *options)
// WithMethods change the behaviour to not protect by default, it takes a list of fully qualified method names to protect, e.g. /helloworld.Greeter/SayHello
func WithMethods(methods ...string) Option {
return func(o *options) {
o.methods = append(o.methods, methods...)
}
}
// WithIgnoredMethods bypass auth for the given methods, it takes a list of fully qualified method name, e.g. /helloworld.Greeter/SayHello
func WithIgnoredMethods(methods ...string) Option {
return func(o *options) {
o.ignoredMethods = append(o.ignoredMethods, methods...)