AI-generated Key Takeaways
- 
          GMTDAuthorization is a protocol designed to provide authorization tokens for gRPC calls, enabling access to Fleet Engine service accounts. 
- 
          The protocol mandates that a valid authorization token is consistently available, with a minimum lifetime of 5 minutes to facilitate request completion. 
- 
          Token implementations must renew expiring tokens automatically and minimize refreshes by reusing them until near expiration. 
- 
          Implementations of this protocol are required to be thread-safe, ensuring proper concurrent handling. 
- 
          The fetchTokenWithContext:completion:method, which can be invoked from arbitrary queues, is used by the SDK to retrieve a JWT and must call the provided completion block asynchronously.
GMTDAuthorization
@protocol GMTDAuthorization <NSObject>Protocol used to provide authorization tokens for gRPC calls. These tokens give access to the Fleet Engine service accounts.
The implementation should ensure that a valid authorization token is always available. The authorization token should have a minimum lifetime of 5 minutes to allow for requests to complete. Therefore, the authorization token must automatically renew expiring tokens and minimize the number of token refreshes by re-using a token until its lifetime nears its end.
Implementations of this protocol must be thread-safe.
- 
                  
                  Called by the SDK to fetch a JWT. The implementation must assume that this method may be invoked from arbitrary queues. DeclarationSwift func fetchToken(with authorizationContext: GMTDAuthorizationContext?) async throws -> StringObjective-C - (void)fetchTokenWithContext: (nullable GMTDAuthorizationContext *)authorizationContext completion: (nonnull GMTDAuthTokenFetchCompletionHandler)completion;ParametersauthorizationContextThe context of the target authorization token. completionMust be called asynchronously, but can be called from any queue.