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

com.codeborne.selenide.BearerTokenCredentials Maven / Gradle / Ivy

The newest version!
package com.codeborne.selenide;

import java.util.regex.Pattern;

public class BearerTokenCredentials implements Credentials {
  private static final Pattern REGEX_ANY_CHAR = Pattern.compile(".");
  public final String domain;
  public final String token;

  public BearerTokenCredentials(String domain, String token) {
    this.domain = domain;
    this.token = token;
  }

  @Override
  public String domain() {
    return domain;
  }

  @Override
  public String encode() {
    return token;
  }

  @Override
  public String toString() {
    return String.format("%s:%s", domain, REGEX_ANY_CHAR.matcher(token).replaceAll("*"));
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy