Class ConnectorApiKeyContext
java.lang.Object
ai.pipestream.connector.ConnectorApiKeyContext
Holds the connector call credentials captured from gRPC metadata by
ConnectorApiKeyInterceptor, exposing them to the handler thread.
Consolidates the per-connector GrpcRequestContext classes. Credentials
enter only via gRPC metadata (x-api-key / x-datasource-id) — never
a protobuf body field — matching the platform's api-key-in-metadata convention.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringapiKey()The calling request's api key, or""when the header was absent.static <T> TRunsbodywith the given credentials bound, for in-process callers that bypass the gRPC server (tests, internal replays).static StringThe calling request's datasource id, or""when the header was absent.
-
Method Details
-
apiKey
The calling request's api key, or""when the header was absent. Valid on any thread carrying the call's gRPC Context.- Returns:
- the
x-api-keyvalue, never null
-
datasourceId
The calling request's datasource id, or""when the header was absent.- Returns:
- the
x-datasource-idvalue, never null
-
callWith
Runsbodywith the given credentials bound, for in-process callers that bypass the gRPC server (tests, internal replays). Over the wire the interceptor binds them from metadata instead.- Type Parameters:
T- the body's result type- Parameters:
apiKey- the api key to binddatasourceId- the datasource id to bindbody- the work to run with the credentials bound- Returns:
body's result- Throws:
Exception- whateverbodythrows
-