zitadel/internal/api/grpc/header.go

18 lines
366 B
Go
Raw Normal View History

2020-03-23 07:01:59 +01:00
package grpc
import (
"context"
"github.com/grpc-ecosystem/go-grpc-middleware/util/metautils"
2020-03-23 13:26:05 +01:00
"github.com/caos/zitadel/internal/api"
2020-03-23 07:01:59 +01:00
)
func GetHeader(ctx context.Context, headername string) string {
return metautils.ExtractIncoming(ctx).Get(headername)
}
func GetAuthorizationHeader(ctx context.Context) string {
2020-03-23 13:26:05 +01:00
return GetHeader(ctx, api.Authorization)
2020-03-23 07:01:59 +01:00
}