All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dart2-v3template.auth.http_basic_auth.mustache Maven / Gradle / Ivy

Go to download

dart2 generator from openapi 3.x spec files. Changing to openapitools dependencies.

The newest version!
part of {{pubName}}.api;

class HttpBasicAuth implements Authentication {

  String _username;
  String _password;

  @override
  void applyToParams(List queryParams, Map headerParams) {
    String str = (_username == null ? "" : _username) + ":" + (_password == null ? "" : _password);
    headerParams["Authorization"] = "Basic " + base64.encode(utf8.encode(str));
  }

  set username(String username) => _username = username;
  set password(String password) => _password = password;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy