feat: add unified authorization middleware
This commit is contained in:
@@ -31,7 +31,14 @@ func main() {
|
||||
config.New(ServiceKey)
|
||||
impl.NewImpl()
|
||||
|
||||
srv := allserver.New()
|
||||
srv, err := allserver.New(
|
||||
config.Spec.Authorization.Key,
|
||||
config.Spec.Authorization.Expire,
|
||||
config.Spec.Authorization.Anonymous,
|
||||
)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if err := service.Expose(srv); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -45,7 +52,7 @@ func main() {
|
||||
_ = srv.Stop(ctx)
|
||||
}()
|
||||
|
||||
if err := srv.Start(config.Spec.Server.GRPC.Addr, config.Spec.Server.HTTP.Addr, config.Spec.DynamicRPC.Allow); err != nil && err != http.ErrServerClosed {
|
||||
if err := srv.Start(config.Spec.Server.GRPC.Addr, config.Spec.Server.HTTP.Addr); err != nil && err != http.ErrServerClosed {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user