GUACAMOLE-103: Move to using Translatable for redirect message; clean up comments.

This commit is contained in:
Virtually Nick
2020-06-21 22:00:34 -04:00
parent 5762cdda47
commit a0ee0475ed
7 changed files with 39 additions and 43 deletions

View File

@@ -33,6 +33,7 @@ import org.apache.guacamole.auth.cas.conf.ConfigurationService;
import org.apache.guacamole.auth.cas.form.CASTicketField;
import org.apache.guacamole.auth.cas.ticket.TicketValidationService;
import org.apache.guacamole.auth.cas.user.CASAuthenticatedUser;
import org.apache.guacamole.language.TranslatableMessage;
/**
* Service providing convenience functions for the CAS AuthenticationProvider
@@ -100,7 +101,7 @@ public class AuthenticationProviderService {
new CASTicketField(
confService.getAuthorizationEndpoint(),
confService.getRedirectURI(),
"LOGIN.INFO_CAS_REDIRECT_PENDING"
new TranslatableMessage("LOGIN.INFO_CAS_REDIRECT_PENDING")
)
}))

View File

@@ -22,6 +22,7 @@ package org.apache.guacamole.auth.cas.form;
import java.net.URI;
import javax.ws.rs.core.UriBuilder;
import org.apache.guacamole.form.RedirectField;
import org.apache.guacamole.language.TranslatableMessage;
/**
@@ -58,19 +59,19 @@ public class CASTicketField extends RedirectField {
* The URI that the CAS service should redirect to upon successful
* authentication.
*
* @param redirectMsg
* @param redirectMessage
* The message that will be displayed for the user while the redirect
* is processed. This will be processed through Guacamole's translation
* system.
*/
public CASTicketField(URI authorizationEndpoint, URI redirectURI,
String redirectMsg) {
TranslatableMessage redirectMessage) {
super(PARAMETER_NAME, UriBuilder.fromUri(authorizationEndpoint)
.path(CAS_LOGIN_URI)
.queryParam("service", redirectURI)
.build(),
redirectMsg);
redirectMessage);
}

View File

@@ -30,6 +30,7 @@ import org.apache.guacamole.auth.openid.token.TokenValidationService;
import org.apache.guacamole.auth.openid.user.AuthenticatedUser;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.form.Field;
import org.apache.guacamole.language.TranslatableMessage;
import org.apache.guacamole.net.auth.Credentials;
import org.apache.guacamole.net.auth.credentials.CredentialsInfo;
import org.apache.guacamole.net.auth.credentials.GuacamoleInvalidCredentialsException;
@@ -122,7 +123,7 @@ public class AuthenticationProviderService {
confService.getClientID(),
confService.getRedirectURI(),
nonceService.generate(confService.getMaxNonceValidity() * 60000L),
"LOGIN.INFO_OID_PENDING_REDIRECT"
new TranslatableMessage("LOGIN.INFO_OID_PENDING_REDIRECT")
)
}))

View File

@@ -22,6 +22,7 @@ package org.apache.guacamole.auth.openid.form;
import java.net.URI;
import javax.ws.rs.core.UriBuilder;
import org.apache.guacamole.form.RedirectField;
import org.apache.guacamole.language.TranslatableMessage;
/**
* Field definition which represents the token returned by an OpenID Connect
@@ -64,13 +65,13 @@ public class TokenField extends RedirectField {
* A random string unique to this request. To defend against replay
* attacks, this value must cease being valid after its first use.
*
* @param redirectMsg
* @param redirectMessage
* The message that will be displayed to the user during redirect. This
* will be processed through Guacamole's translation system.
*/
public TokenField(URI authorizationEndpoint, String scope,
String clientID, URI redirectURI, String nonce,
String redirectMsg) {
TranslatableMessage redirectMessage) {
super(PARAMETER_NAME, UriBuilder.fromUri(authorizationEndpoint)
.queryParam("scope", scope)
@@ -79,7 +80,7 @@ public class TokenField extends RedirectField {
.queryParam("redirect_uri", redirectURI)
.queryParam("nonce", nonce)
.build(),
redirectMsg);
redirectMessage);
}