Skip to content

Commit

Permalink
Create constants file for identity constants
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Jan 14, 2025
1 parent 95f74c9 commit 21bc3d9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

package org.opensearch.identity;

/**
* Class containing constants used in the identity module
*
* @opensearch.experimental
*/
public class IdentityConstants {
public static final String SUBJECT_TRANSIENT_NAME = "subject.name";
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import org.opensearch.core.action.ActionListener;
import org.opensearch.core.action.ActionResponse;

import static org.opensearch.identity.IdentityConstants.SUBJECT_TRANSIENT_NAME;

/**
* Implementation of client that will run transport actions in a stashed context and inject the name of the provided
* subject into the context.
Expand All @@ -30,8 +32,6 @@ public class RunAsSubjectClient extends FilterClient {

private static final Logger logger = LogManager.getLogger(RunAsSubjectClient.class);

public static final String SUBJECT_TRANSIENT_NAME = "subject.name";

private final Subject subject;

public RunAsSubjectClient(Client delegate, Subject subject) {
Expand Down

0 comments on commit 21bc3d9

Please sign in to comment.