![JAR search and dependency download from the Maven repository](/logo.png)
com.atlassian.usercontext.api.UserContextSetter Maven / Gradle / Ivy
package com.atlassian.usercontext.api;
import javax.annotation.Nullable;
import java.util.Optional;
/**
* The companion of the {@link UserContextProvider} API. It allows us to set the
* incoming user context from a cookie, HTTP header or SQS message {@code tenantId}.
*/
public interface UserContextSetter {
/**
* This method allows us to set the incoming from a HTTP header or SQS
* message.
*
* The userContext is not validated when this method is called.
*
* @param userContext token, may be null to unset
*/
void setUserContext(@Nullable UserContext userContext);
/**
* This method allows us to set the incoming from a jwt from a HTTP header or SQS
* message.
*
* The userContext is validated when this method is called
*
* @param validUserContext base64 encoded jwt string, may be null to unset
* @return the new user context if it was valid or
*/
Optional setUserContextFromJwt(@Nullable String validUserContext);
Optional authenticateAndSetUserContext(AuthenticationRequest request);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy