GUACAMOLE-641: Rename vault-specific username token to "USERNAME" to avoid confusion with "GUAC_USERNAME".

The "GUAC_USERNAME" token provided by the webapp is based off the
username provided by the user when they authenticated. The username
token provided by the vault extensions uses the username stored with
the user's corresponding object, which may not be the same.
This commit is contained in:
Michael Jumper
2022-01-21 15:23:41 -08:00
parent f99b3a3213
commit b57578ad8e

View File

@@ -53,10 +53,13 @@ public class VaultUserContext extends TokenInjectingUserContext {
/** /**
* The name of the token which will be replaced with the username of the * The name of the token which will be replaced with the username of the
* current user if specified within the name of a secret. This token * current user if specified within the name of a secret. Unlike the
* applies to both connections and connection groups. * standard GUAC_USERNAME token, the username stored with the object
* representing the user is used here, not necessarily the username
* provided during authentication. This token applies to both connections
* and connection groups.
*/ */
private static final String USERNAME_TOKEN = "GUAC_USERNAME"; private static final String USERNAME_TOKEN = "USERNAME";
/** /**
* The name of the token which will be replaced with the name of the * The name of the token which will be replaced with the name of the
@@ -139,7 +142,7 @@ public class VaultUserContext extends TokenInjectingUserContext {
/** /**
* Creates a new TokenFilter instance with token values set for all tokens * Creates a new TokenFilter instance with token values set for all tokens
* which are not specific to connections or connection groups. Currently, * which are not specific to connections or connection groups. Currently,
* this is only the username token ("GUAC_USERNAME"). * this is only the vault-specific username token ("USERNAME").
* *
* @return * @return
* A new TokenFilter instance with token values set for all tokens * A new TokenFilter instance with token values set for all tokens