Skip to content

Commit

Permalink
Default user attributes now configurable (#128)
Browse files Browse the repository at this point in the history
* Default user attributes now configurable

* Update assertion in create user test
  • Loading branch information
joneubank authored Jul 13, 2018
1 parent b953c95 commit 926b0c7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/main/java/org/overture/ego/service/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.overture.ego.repository.queryspecification.UserSpecification;
import org.overture.ego.token.IDToken;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
Expand All @@ -50,8 +51,10 @@ public class UserService extends BaseService<User, UUID> {
Constants
*/
// DEFAULTS
private final static String DEFAULT_USER_ROLE = UserRole.USER.toString();
private final static String DEFAULT_USER_STATUS = UserStatus.PENDING.toString();
@Value("${default.user.role}")
private String DEFAULT_USER_ROLE;
@Value("${default.user.status}")
private String DEFAULT_USER_STATUS;

// DEMO USER
private final static String DEMO_USER_NAME = "[email protected]";
Expand Down
8 changes: 7 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ facebook:
# Google Connection Details
google:
client:
Ids: 808545688838-99s198l9lhl2hsvkpo5u91f3sflegemp.apps.googleusercontent.com,911372380614-7m296bg4eadc7m43e2mm6fs1a0ggkke1.apps.googleusercontent.com,814606937527-v7tr5dfqegjijicq3jeu5arv5tcl4ks0.apps.googleusercontent.com,814606937527-kk7ooglk6pj2tvpn7ldip6g3b74f8o72.apps.googleusercontent.com
Ids: 144611473365-k1aarg8qs6rlh67r3t7dssi1e34b6061.apps.googleusercontent.com

# Logging settings.
logging:
Expand All @@ -62,6 +62,12 @@ logging:
token:
private-key: MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDSU6oy48sJW6xzqzOSU1dAvUUeFKQSBH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AOdjhcRBWZuJ0XMrtaKCKqCEAtW+CYEKkGXvMOWcHbNkkeZwv8zkQ73dNRqhFnjgVn3RDNyV20uteueK23YNLkQP+KV89fnuCpdcIw9joiqq/NYuIHoQKBgB5WaZ8KH/lCA8babYEjv/pubZWXUl4plISbja17wBYZ4/bl+F1hhhMr7Wk//743dF2NG7TT6W0VTvHXr9IoaMP65uQmKgfbNpsGn294ZClGEFClz+t0KpZyTpZvL0fjibr8u+GLfkxkP5qt2wjif7KRlrKjklTTva+KAVn2cW1FAoGBAMkX9ekIwhx/7uY6ndxKl8ZMDerjr6MhV0b08hHp3RxHbYVbcpN0UKspoYvZVgHwP18xlDij8yWRE2fapwgi4m82ZmYlg0qqJmyqIU9vBB3Jow903h1KPQrkmQEZxJ/4H8yrbgVf2HT+WUfjTFgaDZRl01bI3YkydCw91/Ub9HU6
public-key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0lOqMuPLCVusc6szklNXQL1FHhSkEgR7An+8BllBqTsRHM4bRYosseGFCbYPn8r8FsWuMDtxp0CwTyMQR2PCbJ740DdpbE1KC6jAfZxqcBete7gP0tooJtbvnA6X4vNpG4ukhtUoN9DzNOO0eqMU0Rgyy5HjERdYEWkwTNB30i9I+nHFOSj4MGLBSxNlnuo3keeomCRgtimCx+L/K3HNo0QHTG1J7RzLVAchfQT0lu3pUJ8kB+UM6/6NG+fVyysJyRZ9gadsr4gvHHckw8oUBp2tHvqBEkEdY+rt1Mf5jppt7JUV7HAPLB/qR5jhALY2FX/8MN+lPLmb/nLQQichVQIDAQAB

# Default values available for creation of entities
default:
user:
role: USER
status: Approved
---
###############################################################################
# Profile - "jks"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void testCreateFromIDToken() {
assertThat(idTokenUser.getEmail()).isEqualTo("[email protected]");
assertThat(idTokenUser.getFirstName()).isEqualTo("User");
assertThat(idTokenUser.getLastName()).isEqualTo("User");
assertThat(idTokenUser.getStatus()).isEqualTo("Pending");
assertThat(idTokenUser.getStatus()).isEqualTo("Approved");
assertThat(idTokenUser.getRole()).isEqualTo("USER");
}

Expand Down

0 comments on commit 926b0c7

Please sign in to comment.