mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-21 07:17:39 +00:00
fa9f581d56
* chore: move to new org * logging * fix: org rename caos -> zitadel Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
23 lines
557 B
Go
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)
|
|
}
|