AuthorizationInterceptor class Null safety

Interceptor that attaches the authorziation header if needed. If the request already contains the header, it is not overwritten. The token is public, so it can be updated in later stages of the application, for example when rolling tokens are used.

Inheritance

Constructors

AuthorizationInterceptor(String token, {String type = 'Bearer'})

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
token String
read / write

Methods

interceptStreaming<TRequest, TResponse>(ClientMethod<TRequest, TResponse> method, Stream<TRequest> requests, CallOptions options, ClientStreamingInvoker<TRequest, TResponse> invoker) ResponseStream<TResponse>
override
interceptUnary<TRequest, TResponse>(ClientMethod<TRequest, TResponse> method, TRequest request, CallOptions options, ClientUnaryInvoker<TRequest, TResponse> invoker) ResponseFuture<TResponse>
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited