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) {
ScopeMappingRepresentation mapping = new ScopeMappingRepresentation();
mapping.setUsername(username);
mapping.setClient(username);
if (scopeMappings == null) scopeMappings = new ArrayList<ScopeMappingRepresentation>();
scopeMappings.add(mapping);
return mapping;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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