part of api;

class HttpBasicAuth implements Authentication {

  String username;
  String password;

  @override
  void applyToParams(Map<String, String> queryParams, Map<String, String> headerParams) {
    String str = (username == null ? "" : username) + ":" + (password == null ? "" : password);
    headerParams["Authorization"] = "Basic " + CryptoUtils.bytesToBase64(UTF8.encode(str));
  }

}