grpc/auth/auth.go
func (c *TokenCredentials) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {
	md := ttnctx.MetadataFromOutgoingContext(ctx)
	token, _ := ttnctx.TokenFromMetadata(md)
	if token != "" {
		return map[string]string{tokenKey: token}, nil
	}
	if c.tokenFunc != nil {
		var k string
		if v, ok := md[c.tokenFuncKey]; ok && len(v) > 0 {
			k = v[0]
		}
		return map[string]string{tokenKey: c.tokenFunc(k)}, nil
	}
	if c.token != "" {
		return map[string]string{tokenKey: c.token}, nil
	}
	return map[string]string{tokenKey: ""}, nil
}
func (c *TokenCredentials) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {
	md := ttnctx.MetadataFromOutgoingContext(ctx)
	token, _ := ttnctx.TokenFromMetadata(md)
	if token != "" {
		return map[string]string{tokenKey: token}, nil
	}
	if c.tokenFunc != nil {
		var k string
		if v, ok := md[c.tokenFuncKey]; ok && len(v) > 0 {
			k = v[0]
		}
		return map[string]string{tokenKey: c.tokenFunc(k)}, nil
	}
	if c.token != "" {
		return map[string]string{tokenKey: c.token}, nil
	}
	return map[string]string{tokenKey: ""}, nil
}
// GetRequestMetadata implements credentials.PerRPCCredentials