zitadel/internal/api/grpc/header.go
Florian Forster fa9f581d56
chore(v2): move to new org (#3499)
* chore: move to new org

* logging

* fix: org rename caos -> zitadel

Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
2022-04-26 23:01:45 +00:00

23 lines
557 B
Go

package grpc
import (
"context"
"github.com/grpc-ecosystem/go-grpc-middleware/util/metautils"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/zitadel/zitadel/internal/api/http"
)
func GetHeader(ctx context.Context, headername string) string {
return metautils.ExtractIncoming(ctx).Get(headername)
}
func GetGatewayHeader(ctx context.Context, headername string) string {
return GetHeader(ctx, runtime.MetadataPrefix+headername)
}
func GetAuthorizationHeader(ctx context.Context) string {
return GetHeader(ctx, http.Authorization)
}