(ctx context.Context)
| 76 | } |
| 77 | |
| 78 | func prepareClientContext(ctx context.Context) context.Context { |
| 79 | if loc, ok := locale.FromCtx(ctx); ok { |
| 80 | ctx = metadata.AppendToOutgoingContext(ctx, MetadataKeyLocale, loc.Serialize()) |
| 81 | } |
| 82 | if token, ok := security.GetTokenFromContext(ctx); ok { |
| 83 | ctx = metadata.AppendToOutgoingContext(ctx, MetadataKeyBearerToken, token.GetValue()) |
| 84 | } |
| 85 | if reqID := log.RequestIDFromContext(ctx); reqID != "" { |
| 86 | ctx = metadata.AppendToOutgoingContext(ctx, MetadataKeyRequestID, reqID) |
| 87 | } |
| 88 | ctx = EncodeContextWithUTMData(ctx) |
| 89 | |
| 90 | if dep := middleware.ExternalDependencyContextFromContext(ctx); dep != nil { |
| 91 | ctx = metadata.AppendToOutgoingContext(ctx, MetadataKeyExternalDependencies, dep.String()) |
| 92 | } |
| 93 | |
| 94 | return ctx |
| 95 | } |
no test coverage detected
searching dependent graphs…