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

com.atlassian.bamboo.specs.util.TokenCredentials Maven / Gradle / Ivy

There is a newer version: 10.1.0
Show newest version
package com.atlassian.bamboo.specs.util;

import org.apache.http.HttpHeaders;
import org.apache.http.client.methods.HttpRequestBase;

import static java.lang.String.format;

public interface TokenCredentials extends AuthenticationProvider {

    String getToken();

    @Override
    default void authenticate(final HttpRequestBase request) {
        request.addHeader("Authorization", format("Bearer %s", this.getToken()));
        request.addHeader(HttpHeaders.ACCEPT, "application/json");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy