updateParamsForAuth method

Future updateParamsForAuth(
  1. Set<String> authNames,
  2. QueryParams queryParams,
  3. Map<String, String?> headerParams
)

Update query and header parameters based on authentication settings. @param authNames The authentications to apply

Implementation

Future updateParamsForAuth(Set<String> authNames, QueryParams queryParams,
    Map<String, String?> headerParams) async {
  for (var authName in authNames.orEmptyIter().toList()) {
    Authentication? auth = authentications[authName];
    if (auth == null) {
      throw ArgumentError("Authentication undefined: " +
          authName +
          " but found ${authentications.keys}");
    }
    await auth.applyToParams(queryParams, headerParams);
  }
}