Merge pull request #247 from patriot1burke/master

rename scope rep username to client
This commit is contained in:
Bill Burke 2014-02-26 22:23:30 -05:00
commit 4f56170b4c
10 changed files with 23 additions and 23 deletions

View file

@ -159,7 +159,7 @@ public class RealmRepresentation {
public ScopeMappingRepresentation scopeMapping(String username) { public ScopeMappingRepresentation scopeMapping(String username) {
ScopeMappingRepresentation mapping = new ScopeMappingRepresentation(); ScopeMappingRepresentation mapping = new ScopeMappingRepresentation();
mapping.setUsername(username); mapping.setClient(username);
if (scopeMappings == null) scopeMappings = new ArrayList<ScopeMappingRepresentation>(); if (scopeMappings == null) scopeMappings = new ArrayList<ScopeMappingRepresentation>();
scopeMappings.add(mapping); scopeMappings.add(mapping);
return mapping; return mapping;

View file

@ -9,7 +9,7 @@ import java.util.Set;
*/ */
public class ScopeMappingRepresentation { public class ScopeMappingRepresentation {
protected String self; // link protected String self; // link
protected String username; protected String client;
protected Set<String> roles; protected Set<String> roles;
public String getSelf() { public String getSelf() {
@ -20,12 +20,12 @@ public class ScopeMappingRepresentation {
this.self = self; this.self = self;
} }
public String getUsername() { public String getClient() {
return username; return client;
} }
public void setUsername(String username) { public void setClient(String client) {
this.username = username; this.client = client;
} }
public Set<String> getRoles() { public Set<String> getRoles() {

View file

@ -44,15 +44,15 @@
], ],
"scopeMappings": [ "scopeMappings": [
{ {
"username": "third-party", "client": "third-party",
"roles": ["user"] "roles": ["user"]
}, },
{ {
"username": "customer-portal", "client": "customer-portal",
"roles": ["user"] "roles": ["user"]
}, },
{ {
"username": "product-portal", "client": "product-portal",
"roles": ["user"] "roles": ["user"]
} }

View file

@ -91,11 +91,11 @@
], ],
"scopeMappings": [ "scopeMappings": [
{ {
"username": "REALM_COMPOSITE_1_APPLICATION", "client": "REALM_COMPOSITE_1_APPLICATION",
"roles": ["REALM_COMPOSITE_1"] "roles": ["REALM_COMPOSITE_1"]
}, },
{ {
"username": "REALM_ROLE_1_APPLICATION", "client": "REALM_ROLE_1_APPLICATION",
"roles": ["REALM_ROLE_1"] "roles": ["REALM_ROLE_1"]
} }
], ],
@ -221,7 +221,7 @@
"applicationScopeMappings": { "applicationScopeMappings": {
"APP_ROLE_APPLICATION": [ "APP_ROLE_APPLICATION": [
{ {
"username": "APP_COMPOSITE_APPLICATION", "client": "APP_COMPOSITE_APPLICATION",
"roles": ["APP_ROLE_2"] "roles": ["APP_ROLE_2"]
} }
] ]

View file

@ -53,7 +53,7 @@
], ],
"scopeMappings": [ "scopeMappings": [
{ {
"username": "third-party", "client": "third-party",
"roles": ["user"] "roles": ["user"]
} }
], ],

View file

@ -119,7 +119,7 @@
], ],
"scopeMappings": [ "scopeMappings": [
{ {
"username": "oauthclient", "client": "oauthclient",
"roles": ["admin"] "roles": ["admin"]
} }
], ],
@ -148,7 +148,7 @@
"applicationScopeMappings": { "applicationScopeMappings": {
"Application": [ "Application": [
{ {
"username": "oauthclient", "client": "oauthclient",
"roles": ["app-user"] "roles": ["app-user"]
} }
] ]

View file

@ -123,7 +123,7 @@ public class ApplicationManager {
if (role == null) { if (role == null) {
role = applicationModel.addRole(roleString.trim()); role = applicationModel.addRole(roleString.trim());
} }
ClientModel client = realm.findClient(mapping.getUsername()); ClientModel client = realm.findClient(mapping.getClient());
realm.addScopeMapping(client, role); realm.addScopeMapping(client, role);
} }
} }

View file

@ -361,7 +361,7 @@ public class RealmManager {
if (role == null) { if (role == null) {
role = newRealm.addRole(roleString.trim()); role = newRealm.addRole(roleString.trim());
} }
UserModel user = userMap.get(scope.getUsername()); UserModel user = userMap.get(scope.getClient());
ClientModel client = newRealm.findClient(user.getLoginName()); ClientModel client = newRealm.findClient(user.getLoginName());
newRealm.addScopeMapping(client, role); newRealm.addScopeMapping(client, role);
} }

View file

@ -91,11 +91,11 @@
], ],
"scopeMappings": [ "scopeMappings": [
{ {
"username": "REALM_COMPOSITE_1_APPLICATION", "client": "REALM_COMPOSITE_1_APPLICATION",
"roles": ["REALM_COMPOSITE_1"] "roles": ["REALM_COMPOSITE_1"]
}, },
{ {
"username": "REALM_ROLE_1_APPLICATION", "client": "REALM_ROLE_1_APPLICATION",
"roles": ["REALM_ROLE_1"] "roles": ["REALM_ROLE_1"]
} }
], ],
@ -221,7 +221,7 @@
"applicationScopeMappings": { "applicationScopeMappings": {
"APP_ROLE_APPLICATION": [ "APP_ROLE_APPLICATION": [
{ {
"username": "APP_COMPOSITE_APPLICATION", "client": "APP_COMPOSITE_APPLICATION",
"roles": ["APP_ROLE_2"] "roles": ["APP_ROLE_2"]
} }
] ]

View file

@ -46,11 +46,11 @@
], ],
"scopeMappings": [ "scopeMappings": [
{ {
"username": "third-party", "client": "third-party",
"roles": ["user"] "roles": ["user"]
}, },
{ {
"username": "test-app", "client": "test-app",
"roles": ["user"] "roles": ["user"]
} }
], ],
@ -105,7 +105,7 @@
"applicationScopeMappings": { "applicationScopeMappings": {
"test-app": [ "test-app": [
{ {
"username": "third-party", "client": "third-party",
"roles": ["customer-user"] "roles": ["customer-user"]
} }
] ]