KEYCLOAK-1070 Rename 'Access' to 'Applications'

This commit is contained in:
mposolda 2015-04-23 17:53:16 +02:00
parent c942a8ac4f
commit 14b3d085a0
13 changed files with 33 additions and 34 deletions

View file

@ -5,6 +5,6 @@ package org.keycloak.account;
*/ */
public enum AccountPages { public enum AccountPages {
ACCOUNT, PASSWORD, TOTP, FEDERATED_IDENTITY, LOG, SESSIONS, ACCESS; ACCOUNT, PASSWORD, TOTP, FEDERATED_IDENTITY, LOG, SESSIONS, APPLICATIONS;
} }

View file

@ -185,7 +185,7 @@ public class FreeMarkerAccountProvider implements AccountProvider {
case SESSIONS: case SESSIONS:
attributes.put("sessions", new SessionsBean(realm, sessions)); attributes.put("sessions", new SessionsBean(realm, sessions));
break; break;
case ACCESS: case APPLICATIONS:
attributes.put("consent", new ConsentBean(user)); attributes.put("consent", new ConsentBean(user));
attributes.put("advancedMsg", new AdvancedMessageFormatterMethod(locale, messagesBundle)); attributes.put("advancedMsg", new AdvancedMessageFormatterMethod(locale, messagesBundle));
break; break;

View file

@ -21,8 +21,8 @@ public class Templates {
return "log.ftl"; return "log.ftl";
case SESSIONS: case SESSIONS:
return "sessions.ftl"; return "sessions.ftl";
case ACCESS: case APPLICATIONS:
return "access.ftl"; return "applications.ftl";
default: default:
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }

View file

@ -27,8 +27,8 @@ public class UrlBean {
this.stateChecker = stateChecker; this.stateChecker = stateChecker;
} }
public String getAccessUrl() { public String getApplicationsUrl() {
return Urls.accountAccessPage(baseQueryURI, realm).toString(); return Urls.accountApplicationsPage(baseQueryURI, realm).toString();
} }
public String getAccountUrl() { public String getAccountUrl() {

View file

@ -1,9 +1,9 @@
<#import "template.ftl" as layout> <#import "template.ftl" as layout>
<@layout.mainLayout active='access' bodyClass='access'; section> <@layout.mainLayout active='applications' bodyClass='applications'; section>
<div class="row"> <div class="row">
<div class="col-md-10"> <div class="col-md-10">
<h2>${msg("accessHtmlTitle")}</h2> <h2>${msg("applicationsHtmlTitle")}</h2>
</div> </div>
</div> </div>

View file

@ -66,7 +66,7 @@ details=Details
started=Startdatum started=Startdatum
lastAccess=Letzter Zugriff lastAccess=Letzter Zugriff
expires=Ablaufdatum expires=Ablaufdatum
applications= applications=Applicationen
account=Benutzerkonto account=Benutzerkonto
federatedIdentity=Federated Identity federatedIdentity=Federated Identity

View file

@ -12,7 +12,7 @@ changePasswordHtmlTitle=Change Password
sessionsHtmlTitle=Sessions sessionsHtmlTitle=Sessions
accountManagementTitle=Keycloak Account Management accountManagementTitle=Keycloak Account Management
authenticatorTitle=Authenticator authenticatorTitle=Authenticator
accessHtmlTitle=Manage Granted Permissions applicationsHtmlTitle=Manage Granted Permissions
authenticatorCode=One-time code authenticatorCode=One-time code
email=Email email=Email
@ -77,13 +77,12 @@ federatedIdentity=Federated Identity
authenticator=Authenticator authenticator=Authenticator
sessions=Sessions sessions=Sessions
log=Log log=Log
access=Access
grantedPersonalInfo=Granted Personal Info grantedPersonalInfo=Granted Personal Info
grantedPermissions=Granted Permissions grantedPermissions=Granted Permissions
action=Action action=Action
inResource=in inResource=in
revoke=Revoke Access revoke=Revoke Grant
configureAuthenticators=Configured Authenticators configureAuthenticators=Configured Authenticators
mobile=Mobile mobile=Mobile
@ -109,7 +108,7 @@ readOnlyPasswordMessage=You can''t update your password as your account is read
successTotpMessage=Mobile authenticator configured. successTotpMessage=Mobile authenticator configured.
successTotpRemovedMessage=Mobile authenticator removed. successTotpRemovedMessage=Mobile authenticator removed.
successGrantRevokedMessage=Access revoked successfully. successGrantRevokedMessage=Grant revoked successfully.
accountUpdatedMessage=Your account has been updated. accountUpdatedMessage=Your account has been updated.
accountPasswordUpdatedMessage=Your password has been updated. accountPasswordUpdatedMessage=Your password has been updated.

View file

@ -56,7 +56,7 @@
<li class="<#if active=='totp'>active</#if>"><a href="${url.totpUrl}">${msg("authenticator")}</a></li> <li class="<#if active=='totp'>active</#if>"><a href="${url.totpUrl}">${msg("authenticator")}</a></li>
<#if features.identityFederation><li class="<#if active=='social'>active</#if>"><a href="${url.socialUrl}">${msg("federatedIdentity")}</a></li></#if> <#if features.identityFederation><li class="<#if active=='social'>active</#if>"><a href="${url.socialUrl}">${msg("federatedIdentity")}</a></li></#if>
<li class="<#if active=='sessions'>active</#if>"><a href="${url.sessionsUrl}">${msg("sessions")}</a></li> <li class="<#if active=='sessions'>active</#if>"><a href="${url.sessionsUrl}">${msg("sessions")}</a></li>
<li class="<#if active=='access'>active</#if>"><a href="${url.accessUrl}">${msg("access")}</a></li> <li class="<#if active=='applications'>active</#if>"><a href="${url.applicationsUrl}">${msg("applications")}</a></li>
<#if features.log><li class="<#if active=='log'>active</#if>"><a href="${url.logUrl}">${msg("log")}</a></li></#if> <#if features.log><li class="<#if active=='log'>active</#if>"><a href="${url.logUrl}">${msg("log")}</a></li></#if>
</ul> </ul>
</div> </div>

View file

@ -39,8 +39,8 @@ import java.net.URI;
*/ */
public class Urls { public class Urls {
public static URI accountAccessPage(URI baseUri, String realmId) { public static URI accountApplicationsPage(URI baseUri, String realmId) {
return accountBase(baseUri).path(AccountService.class, "accessPage").build(realmId); return accountBase(baseUri).path(AccountService.class, "applicationsPage").build(realmId);
} }
public static UriBuilder accountBase(URI baseUri) { public static UriBuilder accountBase(URI baseUri) {

View file

@ -349,10 +349,10 @@ public class AccountService {
return forwardToPage("sessions", AccountPages.SESSIONS); return forwardToPage("sessions", AccountPages.SESSIONS);
} }
@Path("access") @Path("applications")
@GET @GET
public Response accessPage() { public Response applicationsPage() {
return forwardToPage("access", AccountPages.ACCESS); return forwardToPage("applications", AccountPages.APPLICATIONS);
} }
/** /**
@ -494,7 +494,7 @@ public class AccountService {
@POST @POST
public Response processRevokeGrant(final MultivaluedMap<String, String> formData) { public Response processRevokeGrant(final MultivaluedMap<String, String> formData) {
if (auth == null) { if (auth == null) {
return login("access"); return login("applications");
} }
require(AccountRoles.MANAGE_ACCOUNT); require(AccountRoles.MANAGE_ACCOUNT);
@ -502,11 +502,11 @@ public class AccountService {
String clientId = formData.getFirst("clientId"); String clientId = formData.getFirst("clientId");
if (clientId == null) { if (clientId == null) {
return account.setError(Messages.CLIENT_NOT_FOUND).createResponse(AccountPages.ACCESS); return account.setError(Messages.CLIENT_NOT_FOUND).createResponse(AccountPages.APPLICATIONS);
} }
ClientModel client = realm.getClientById(clientId); ClientModel client = realm.getClientById(clientId);
if (client == null) { if (client == null) {
return account.setError(Messages.CLIENT_NOT_FOUND).createResponse(AccountPages.ACCESS); return account.setError(Messages.CLIENT_NOT_FOUND).createResponse(AccountPages.APPLICATIONS);
} }
// Revoke grant in UserModel // Revoke grant in UserModel
@ -527,7 +527,7 @@ public class AccountService {
event.event(EventType.REVOKE_GRANT).client(auth.getClient()).user(auth.getUser()).detail(Details.REVOKED_CLIENT, client.getClientId()).success(); event.event(EventType.REVOKE_GRANT).client(auth.getClient()).user(auth.getUser()).detail(Details.REVOKED_CLIENT, client.getClientId()).success();
setReferrerOnPage(); setReferrerOnPage();
return account.setSuccess(Messages.SUCCESS_GRANT_REVOKED).createResponse(AccountPages.ACCESS); return account.setSuccess(Messages.SUCCESS_GRANT_REVOKED).createResponse(AccountPages.APPLICATIONS);
} }
/** /**

View file

@ -21,7 +21,7 @@ import org.keycloak.services.managers.RealmManager;
import org.keycloak.services.resources.RealmsResource; import org.keycloak.services.resources.RealmsResource;
import org.keycloak.testsuite.Constants; import org.keycloak.testsuite.Constants;
import org.keycloak.testsuite.OAuthClient; import org.keycloak.testsuite.OAuthClient;
import org.keycloak.testsuite.pages.AccountAccessPage; import org.keycloak.testsuite.pages.AccountApplicationsPage;
import org.keycloak.testsuite.pages.AccountUpdateProfilePage; import org.keycloak.testsuite.pages.AccountUpdateProfilePage;
import org.keycloak.testsuite.pages.LoginPage; import org.keycloak.testsuite.pages.LoginPage;
import org.keycloak.testsuite.pages.OAuthGrantPage; import org.keycloak.testsuite.pages.OAuthGrantPage;
@ -89,7 +89,7 @@ public class ProfileTest {
protected AccountUpdateProfilePage profilePage; protected AccountUpdateProfilePage profilePage;
@WebResource @WebResource
protected AccountAccessPage accountAccessPage; protected AccountApplicationsPage accountApplicationsPage;
@WebResource @WebResource
protected LoginPage loginPage; protected LoginPage loginPage;
@ -191,8 +191,8 @@ public class ProfileTest {
assertEquals("test-user@localhost", profile.getString("username")); assertEquals("test-user@localhost", profile.getString("username"));
accountAccessPage.open(); accountApplicationsPage.open();
accountAccessPage.revokeGrant("third-party"); accountApplicationsPage.revokeGrant("third-party");
} }
@Test @Test

View file

@ -8,7 +8,7 @@ import org.keycloak.representations.AccessTokenResponse;
import org.keycloak.services.Urls; import org.keycloak.services.Urls;
import org.keycloak.services.managers.RealmManager; import org.keycloak.services.managers.RealmManager;
import org.keycloak.testsuite.Constants; import org.keycloak.testsuite.Constants;
import org.keycloak.testsuite.pages.AccountAccessPage; import org.keycloak.testsuite.pages.AccountApplicationsPage;
import org.keycloak.testsuite.pages.OAuthGrantPage; import org.keycloak.testsuite.pages.OAuthGrantPage;
import org.keycloak.testsuite.rule.AbstractKeycloakRule; import org.keycloak.testsuite.rule.AbstractKeycloakRule;
import org.keycloak.testsuite.rule.WebResource; import org.keycloak.testsuite.rule.WebResource;
@ -53,17 +53,17 @@ public class OIDCKeyCloakServerBrokerBasicTest extends AbstractIdentityProviderT
private OAuthGrantPage grantPage; private OAuthGrantPage grantPage;
@WebResource @WebResource
protected AccountAccessPage accountAccessPage; protected AccountApplicationsPage accountApplicationsPage;
@Override @Override
protected void revokeGrant() { protected void revokeGrant() {
String currentUrl = driver.getCurrentUrl(); String currentUrl = driver.getCurrentUrl();
String accountAccessPath = Urls.accountAccessPage(UriBuilder.fromUri(Constants.AUTH_SERVER_ROOT).port(PORT).build(), "realm-with-oidc-identity-provider").toString(); String accountAccessPath = Urls.accountApplicationsPage(UriBuilder.fromUri(Constants.AUTH_SERVER_ROOT).port(PORT).build(), "realm-with-oidc-identity-provider").toString();
accountAccessPage.setPath(accountAccessPath); accountApplicationsPage.setPath(accountAccessPath);
accountAccessPage.open(); accountApplicationsPage.open();
try { try {
accountAccessPage.revokeGrant("broker-app"); accountApplicationsPage.revokeGrant("broker-app");
} catch (NoSuchElementException e) { } catch (NoSuchElementException e) {
System.err.println("Couldn't revoke broker-app application, maybe because it wasn't granted or user not logged"); System.err.println("Couldn't revoke broker-app application, maybe because it wasn't granted or user not logged");
} }

View file

@ -21,7 +21,7 @@ public class AccountApplicationsPage extends AbstractAccountPage {
@Override @Override
public boolean isCurrent() { public boolean isCurrent() {
return driver.getTitle().contains("Account Management") && driver.getCurrentUrl().endsWith("/account/access"); return driver.getTitle().contains("Account Management") && driver.getCurrentUrl().endsWith("/account/applications");
} }
@Override @Override