display flows

This commit is contained in:
Bill Burke committed 2015-07-02 11:25:51 -04:00
1 parent 2699bb9a44
commit 917151123f
23 files changed
+204 -40

No files matched your search

@@ -13,6 +13,8 @@ public class AuthenticationFlowModel implements Serializable {
private String alias;
private String description;
private String providerId;
private boolean topLevel;
private boolean builtIn;
public String getId() {
return id;
@@ -45,4 +47,20 @@ public class AuthenticationFlowModel implements Serializable {
public void setProviderId(String providerId) {
this.providerId = providerId;
}
public boolean isTopLevel() {
return topLevel;
}
public void setTopLevel(boolean topLevel) {
this.topLevel = topLevel;
}
public boolean isBuiltIn() {
return builtIn;
}
public void setBuiltIn(boolean builtIn) {
this.builtIn = builtIn;
}
}
@@ -13,6 +13,8 @@ public class AuthenticationFlowEntity {
protected String alias;
protected String description;
protected String providerId;
private boolean topLevel;
private boolean builtIn;
List<AuthenticationExecutionEntity> executions = new ArrayList<AuthenticationExecutionEntity>();
public String getId() {
@@ -54,4 +56,20 @@ public class AuthenticationFlowEntity {
public void setProviderId(String providerId) {
this.providerId = providerId;
}
public boolean isTopLevel() {
return topLevel;
}
public void setTopLevel(boolean topLevel) {
this.topLevel = topLevel;
}
public boolean isBuiltIn() {
return builtIn;
}
public void setBuiltIn(boolean builtIn) {
this.builtIn = builtIn;
}
}
@@ -30,12 +30,16 @@ public class DefaultAuthenticationFlows {
registrationFlow.setAlias(REGISTRATION_FLOW);
registrationFlow.setDescription("registration flow");
registrationFlow.setProviderId("basic-flow");
registrationFlow.setTopLevel(true);
registrationFlow.setBuiltIn(true);
registrationFlow = realm.addAuthenticationFlow(registrationFlow);
AuthenticationFlowModel registrationFormFlow = new AuthenticationFlowModel();
registrationFormFlow.setAlias(REGISTRATION_FORM_FLOW);
registrationFormFlow.setDescription("registration form");
registrationFormFlow.setProviderId("form-flow");
registrationFormFlow.setTopLevel(false);
registrationFormFlow.setBuiltIn(true);
registrationFormFlow = realm.addAuthenticationFlow(registrationFormFlow);
AuthenticationExecutionModel execution;
@@ -103,6 +107,8 @@ public class DefaultAuthenticationFlows {
browser.setAlias(BROWSER_FLOW);
browser.setDescription("browser based authentication");
browser.setProviderId("basic-flow");
browser.setTopLevel(true);
browser.setBuiltIn(true);
browser = realm.addAuthenticationFlow(browser);
AuthenticationExecutionModel execution = new AuthenticationExecutionModel();
execution.setParentFlow(browser.getId());
@@ -123,6 +129,8 @@ public class DefaultAuthenticationFlows {
AuthenticationFlowModel forms = new AuthenticationFlowModel();
forms.setTopLevel(false);
forms.setBuiltIn(true);
forms.setAlias(LOGIN_FORMS_FLOW);
forms.setDescription("Username, password, otp and other auth forms.");
forms.setProviderId("basic-flow");
@@ -1234,6 +1234,8 @@ public class RealmAdapter implements RealmModel {
model.setAlias(entity.getAlias());
model.setDescription(entity.getDescription());
model.setProviderId(entity.getProviderId());
model.setBuiltIn(entity.isBuiltIn());
model.setTopLevel(entity.isTopLevel());
return model;
}
@@ -1268,6 +1270,8 @@ public class RealmAdapter implements RealmModel {
toUpdate.setAlias(model.getAlias());
toUpdate.setDescription(model.getDescription());
toUpdate.setProviderId(model.getProviderId());
toUpdate.setBuiltIn(model.isBuiltIn());
toUpdate.setTopLevel(model.isTopLevel());
}
@@ -1278,6 +1282,8 @@ public class RealmAdapter implements RealmModel {
entity.setAlias(model.getAlias());
entity.setDescription(model.getDescription());
entity.setProviderId(model.getProviderId());
entity.setBuiltIn(model.isBuiltIn());
entity.setTopLevel(model.isTopLevel());
realm.getAuthenticationFlows().add(entity);
model.setId(entity.getId());
return model;
@@ -1544,6 +1544,8 @@ public class RealmAdapter implements RealmModel {
model.setAlias(entity.getAlias());
model.setProviderId(entity.getProviderId());
model.setDescription(entity.getDescription());
model.setBuiltIn(entity.isBuiltIn());
model.setTopLevel(entity.isTopLevel());
return model;
}
@@ -1569,6 +1571,8 @@ public class RealmAdapter implements RealmModel {
entity.setAlias(model.getAlias());
entity.setDescription(model.getDescription());
entity.setProviderId(model.getProviderId());
entity.setBuiltIn(model.isBuiltIn());
entity.setTopLevel(model.isTopLevel());
}
@@ -1579,6 +1583,8 @@ public class RealmAdapter implements RealmModel {
entity.setAlias(model.getAlias());
entity.setDescription(model.getDescription());
entity.setProviderId(model.getProviderId());
entity.setBuiltIn(model.isBuiltIn());
entity.setTopLevel(model.isTopLevel());
entity.setRealm(realm);
realm.getAuthenticationFlows().add(entity);
em.persist(entity);
@@ -42,6 +42,13 @@ public class AuthenticationFlowEntity {
@Column(name="DESCRIPTION")
protected String description;
@Column(name="TOP_LEVEL")
protected boolean topLevel;
@Column(name="BUILT_IN")
protected boolean builtIn;
@OneToMany(fetch = FetchType.LAZY, cascade ={CascadeType.REMOVE}, orphanRemoval = true, mappedBy = "parentFlow")
Collection<AuthenticationExecutionEntity> executions = new ArrayList<AuthenticationExecutionEntity>();
public String getId() {
@@ -91,4 +98,20 @@ public class AuthenticationFlowEntity {
public void setProviderId(String providerId) {
this.providerId = providerId;
}
public boolean isTopLevel() {
return topLevel;
}
public void setTopLevel(boolean topLevel) {
this.topLevel = topLevel;
}
public boolean isBuiltIn() {
return builtIn;
}
public void setBuiltIn(boolean builtIn) {
this.builtIn = builtIn;
}
}
@@ -1308,6 +1308,8 @@ public class RealmAdapter extends AbstractMongoAdapter<MongoRealmEntity> impleme
model.setId(entity.getId());
model.setAlias(entity.getAlias());
model.setDescription(entity.getDescription());
model.setBuiltIn(entity.isBuiltIn());
model.setTopLevel(entity.isTopLevel());
return model;
}
@@ -1342,6 +1344,8 @@ public class RealmAdapter extends AbstractMongoAdapter<MongoRealmEntity> impleme
toUpdate.setAlias(model.getAlias());
toUpdate.setDescription(model.getDescription());
toUpdate.setProviderId(model.getProviderId());
toUpdate.setBuiltIn(model.isBuiltIn());
toUpdate.setTopLevel(model.isTopLevel());
updateMongoEntity();
}
@@ -1352,6 +1356,8 @@ public class RealmAdapter extends AbstractMongoAdapter<MongoRealmEntity> impleme
entity.setAlias(model.getAlias());
entity.setDescription(model.getDescription());
entity.setProviderId(model.getProviderId());
entity.setBuiltIn(model.isBuiltIn());
entity.setTopLevel(model.isTopLevel());
getMongoEntity().getAuthenticationFlows().add(entity);
model.setId(entity.getId());
updateMongoEntity();