public class AppSecret extends Object
GroupController
. It
basically contain information about application group and secret name extracted from user
request.Modifier and Type | Field and Description |
---|---|
static String |
APP_SECRET_PARAM
Secret path param name used in rest controller.
|
static String |
DESC_METADATA |
static String |
FILENAME_METADATA
The attributes used in secret metadata
|
static String |
UNIQ_NAME_SEP
'@' is used as unique name separator as it's url safe.
|
static String |
USERID_METADATA |
Constructor and Description |
---|
AppSecret(String uniqSecretName)
Create
AppSecret from the globally unique secret name. |
AppSecret(String secretName,
AppGroup group)
Constructor for app secret.
|
AppSecret(String secretName,
String domain,
String appName)
Constructor for app secret.
|
Modifier and Type | Method and Description |
---|---|
String |
getAppName()
Returns the app name.
|
AppGroup |
getGroup()
Returns the application group (env) details for the secret (
secretName ) |
String |
getGroupName()
Returns the keywhiz group name.
|
String |
getSecretName()
Returns the secret name used by the user.
|
String |
getUniqSecretName()
Keywhiz is designed to have globally unique names.
|
String |
toString() |
public static final String APP_SECRET_PARAM
public static final String FILENAME_METADATA
public static final String USERID_METADATA
public static final String DESC_METADATA
public static final String UNIQ_NAME_SEP
public AppSecret(@Nonnull String secretName, @Nonnull String domain, @Nonnull String appName)
secretName
- secret name.domain
- Application domainappName
- Application name.public AppSecret(@Nonnull String secretName, @Nonnull AppGroup group)
secretName
- secret name.group
- AppGroup
public String getSecretName()
public AppGroup getGroup()
secretName
)AppGroup
public String getUniqSecretName()
The unique secret name format is := {domain}_{AppGroupName}@{secretName}
Eg: If user uploads a secret with name db-password.txt for an env prod, assembly my-app and org oneops, the app id is oneops_my-app_prod and the secret name stored in keywhiz server will be prod_oneops_my-app_prod@db-password.txt. The initial prod_ is the default domain. The domain is mainly used to support multiple OneOps instances.
public String getGroupName()
public String getAppName()
Copyright © 2018 Walmart, Inc.. All rights reserved.