zitadel/internal/api/grpc/header.go

18 lines
372 B
Go
Raw Normal View History

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