1 package com.atlassian.sal.api.net;
2
3 /**
4 * Interface Request represents a request to retrieve data, using Trusted Apps authentication. To execute a request call {@link Request#execute(com.atlassian.sal.api.net.ResponseHandler)}.
5 *
6 * This extracts methods originally part of {@link com.atlassian.sal.api.net.Request}
7 * @param <T> the type of request used for method chaining
8 * @since 3.0.0
9 */
10 public interface TrustedRequest<T extends Request<?, ?>, RESP extends Response> extends Request
11 {
12 /**
13 * Adds TrustedTokenAuthentication to the request. Trusted token authenticator uses current user to make a trusted application call.
14 *
15 * @param hostname Hostname that this authentication applies to
16 * @return a reference to this object.
17 */
18 T addTrustedTokenAuthentication(final String hostname);
19
20 /**
21 * Adds TrustedTokenAuthentication to the request. Trusted token authenticator uses the passed user to make a trusted application call.
22 *
23 * @param hostname Hostname that this authentication applies to
24 * @param username The user to make the request with
25 * @return this
26 */
27 T addTrustedTokenAuthentication(final String hostname, final String username);
28 }