/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ package org.opensearch.identity; import org.opensearch.identity.tokens.AuthToken; import java.security.Principal; /** * An individual, process, or device that causes information to flow among objects or change to the system state. * * @opensearch.experimental */ public interface Subject { /** * Get the application-wide uniquely identifying principal * */ Principal getPrincipal(); /** * Authenticate via an auth token * throws UnsupportedAuthenticationMethod * throws InvalidAuthenticationToken * throws SubjectNotFound * throws SubjectDisabled */ void authenticate(final AuthToken token); }