KEYCLOAK-1070 Rename 'Access' to 'Applications'
This commit is contained in:
parent
c942a8ac4f
commit
14b3d085a0
13 changed files with 33 additions and 34 deletions
|
@ -5,6 +5,6 @@ package org.keycloak.account;
|
|||
*/
|
||||
public enum AccountPages {
|
||||
|
||||
ACCOUNT, PASSWORD, TOTP, FEDERATED_IDENTITY, LOG, SESSIONS, ACCESS;
|
||||
ACCOUNT, PASSWORD, TOTP, FEDERATED_IDENTITY, LOG, SESSIONS, APPLICATIONS;
|
||||
|
||||
}
|
||||
|
|
|
@ -185,7 +185,7 @@ public class FreeMarkerAccountProvider implements AccountProvider {
|
|||
case SESSIONS:
|
||||
attributes.put("sessions", new SessionsBean(realm, sessions));
|
||||
break;
|
||||
case ACCESS:
|
||||
case APPLICATIONS:
|
||||
attributes.put("consent", new ConsentBean(user));
|
||||
attributes.put("advancedMsg", new AdvancedMessageFormatterMethod(locale, messagesBundle));
|
||||
break;
|
||||
|
|
|
@ -21,8 +21,8 @@ public class Templates {
|
|||
return "log.ftl";
|
||||
case SESSIONS:
|
||||
return "sessions.ftl";
|
||||
case ACCESS:
|
||||
return "access.ftl";
|
||||
case APPLICATIONS:
|
||||
return "applications.ftl";
|
||||
default:
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
|
|
@ -27,8 +27,8 @@ public class UrlBean {
|
|||
this.stateChecker = stateChecker;
|
||||
}
|
||||
|
||||
public String getAccessUrl() {
|
||||
return Urls.accountAccessPage(baseQueryURI, realm).toString();
|
||||
public String getApplicationsUrl() {
|
||||
return Urls.accountApplicationsPage(baseQueryURI, realm).toString();
|
||||
}
|
||||
|
||||
public String getAccountUrl() {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<#import "template.ftl" as layout>
|
||||
<@layout.mainLayout active='access' bodyClass='access'; section>
|
||||
<@layout.mainLayout active='applications' bodyClass='applications'; section>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<h2>${msg("accessHtmlTitle")}</h2>
|
||||
<h2>${msg("applicationsHtmlTitle")}</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ details=Details
|
|||
started=Startdatum
|
||||
lastAccess=Letzter Zugriff
|
||||
expires=Ablaufdatum
|
||||
applications=
|
||||
applications=Applicationen
|
||||
|
||||
account=Benutzerkonto
|
||||
federatedIdentity=Federated Identity
|
||||
|
|
|
@ -12,7 +12,7 @@ changePasswordHtmlTitle=Change Password
|
|||
sessionsHtmlTitle=Sessions
|
||||
accountManagementTitle=Keycloak Account Management
|
||||
authenticatorTitle=Authenticator
|
||||
accessHtmlTitle=Manage Granted Permissions
|
||||
applicationsHtmlTitle=Manage Granted Permissions
|
||||
|
||||
authenticatorCode=One-time code
|
||||
email=Email
|
||||
|
@ -77,13 +77,12 @@ federatedIdentity=Federated Identity
|
|||
authenticator=Authenticator
|
||||
sessions=Sessions
|
||||
log=Log
|
||||
access=Access
|
||||
|
||||
grantedPersonalInfo=Granted Personal Info
|
||||
grantedPermissions=Granted Permissions
|
||||
action=Action
|
||||
inResource=in
|
||||
revoke=Revoke Access
|
||||
revoke=Revoke Grant
|
||||
|
||||
configureAuthenticators=Configured Authenticators
|
||||
mobile=Mobile
|
||||
|
@ -109,7 +108,7 @@ readOnlyPasswordMessage=You can''t update your password as your account is read
|
|||
successTotpMessage=Mobile authenticator configured.
|
||||
successTotpRemovedMessage=Mobile authenticator removed.
|
||||
|
||||
successGrantRevokedMessage=Access revoked successfully.
|
||||
successGrantRevokedMessage=Grant revoked successfully.
|
||||
|
||||
accountUpdatedMessage=Your account has been updated.
|
||||
accountPasswordUpdatedMessage=Your password has been updated.
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
<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>
|
||||
<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>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -39,8 +39,8 @@ import java.net.URI;
|
|||
*/
|
||||
public class Urls {
|
||||
|
||||
public static URI accountAccessPage(URI baseUri, String realmId) {
|
||||
return accountBase(baseUri).path(AccountService.class, "accessPage").build(realmId);
|
||||
public static URI accountApplicationsPage(URI baseUri, String realmId) {
|
||||
return accountBase(baseUri).path(AccountService.class, "applicationsPage").build(realmId);
|
||||
}
|
||||
|
||||
public static UriBuilder accountBase(URI baseUri) {
|
||||
|
|
|
@ -349,10 +349,10 @@ public class AccountService {
|
|||
return forwardToPage("sessions", AccountPages.SESSIONS);
|
||||
}
|
||||
|
||||
@Path("access")
|
||||
@Path("applications")
|
||||
@GET
|
||||
public Response accessPage() {
|
||||
return forwardToPage("access", AccountPages.ACCESS);
|
||||
public Response applicationsPage() {
|
||||
return forwardToPage("applications", AccountPages.APPLICATIONS);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -494,7 +494,7 @@ public class AccountService {
|
|||
@POST
|
||||
public Response processRevokeGrant(final MultivaluedMap<String, String> formData) {
|
||||
if (auth == null) {
|
||||
return login("access");
|
||||
return login("applications");
|
||||
}
|
||||
|
||||
require(AccountRoles.MANAGE_ACCOUNT);
|
||||
|
@ -502,11 +502,11 @@ public class AccountService {
|
|||
|
||||
String clientId = formData.getFirst("clientId");
|
||||
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);
|
||||
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
|
||||
|
@ -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();
|
||||
setReferrerOnPage();
|
||||
|
||||
return account.setSuccess(Messages.SUCCESS_GRANT_REVOKED).createResponse(AccountPages.ACCESS);
|
||||
return account.setSuccess(Messages.SUCCESS_GRANT_REVOKED).createResponse(AccountPages.APPLICATIONS);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.keycloak.services.managers.RealmManager;
|
|||
import org.keycloak.services.resources.RealmsResource;
|
||||
import org.keycloak.testsuite.Constants;
|
||||
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.LoginPage;
|
||||
import org.keycloak.testsuite.pages.OAuthGrantPage;
|
||||
|
@ -89,7 +89,7 @@ public class ProfileTest {
|
|||
protected AccountUpdateProfilePage profilePage;
|
||||
|
||||
@WebResource
|
||||
protected AccountAccessPage accountAccessPage;
|
||||
protected AccountApplicationsPage accountApplicationsPage;
|
||||
|
||||
@WebResource
|
||||
protected LoginPage loginPage;
|
||||
|
@ -191,8 +191,8 @@ public class ProfileTest {
|
|||
|
||||
assertEquals("test-user@localhost", profile.getString("username"));
|
||||
|
||||
accountAccessPage.open();
|
||||
accountAccessPage.revokeGrant("third-party");
|
||||
accountApplicationsPage.open();
|
||||
accountApplicationsPage.revokeGrant("third-party");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.keycloak.representations.AccessTokenResponse;
|
|||
import org.keycloak.services.Urls;
|
||||
import org.keycloak.services.managers.RealmManager;
|
||||
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.rule.AbstractKeycloakRule;
|
||||
import org.keycloak.testsuite.rule.WebResource;
|
||||
|
@ -53,17 +53,17 @@ public class OIDCKeyCloakServerBrokerBasicTest extends AbstractIdentityProviderT
|
|||
private OAuthGrantPage grantPage;
|
||||
|
||||
@WebResource
|
||||
protected AccountAccessPage accountAccessPage;
|
||||
protected AccountApplicationsPage accountApplicationsPage;
|
||||
|
||||
@Override
|
||||
protected void revokeGrant() {
|
||||
String currentUrl = driver.getCurrentUrl();
|
||||
|
||||
String accountAccessPath = Urls.accountAccessPage(UriBuilder.fromUri(Constants.AUTH_SERVER_ROOT).port(PORT).build(), "realm-with-oidc-identity-provider").toString();
|
||||
accountAccessPage.setPath(accountAccessPath);
|
||||
accountAccessPage.open();
|
||||
String accountAccessPath = Urls.accountApplicationsPage(UriBuilder.fromUri(Constants.AUTH_SERVER_ROOT).port(PORT).build(), "realm-with-oidc-identity-provider").toString();
|
||||
accountApplicationsPage.setPath(accountAccessPath);
|
||||
accountApplicationsPage.open();
|
||||
try {
|
||||
accountAccessPage.revokeGrant("broker-app");
|
||||
accountApplicationsPage.revokeGrant("broker-app");
|
||||
} catch (NoSuchElementException e) {
|
||||
System.err.println("Couldn't revoke broker-app application, maybe because it wasn't granted or user not logged");
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ public class AccountApplicationsPage extends AbstractAccountPage {
|
|||
|
||||
@Override
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue