Skip to content

Commit 9c7abe6

Browse files
committed
chore: naming conformance #159
1 parent 26a047e commit 9c7abe6

File tree

23 files changed

+86
-90
lines changed

23 files changed

+86
-90
lines changed

app/src/main/java/org/gluu/casa/core/ConfigurationHandler.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ void init() {
9999
//This is a trick so the timer event logic can be coded inside this managed bean
100100
timerService.addListener(this, acrQuartzJobName);
101101
/*
102-
A gap of 5 seconds is enough for the RestEasy scanning process to take place (in case oxAuth is already up and running)
102+
A gap of 5 seconds is enough for the RestEasy scanning process to take place (in case AS is already up and running)
103103
RETRIES*RETRY_INTERVAL seconds gives room to recover the acr list. This big amount of time may be required
104-
in cases where casa service starts too soon (even before oxAuth itself)
104+
in cases where casa service starts too soon (even before AS itself)
105105
*/
106106
timerService.schedule(acrQuartzJobName, 5, RETRIES, RETRY_INTERVAL);
107107
} else {

app/src/main/java/org/gluu/casa/core/PersistenceService.java

+26-26
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727

2828
import org.gluu.casa.model.ApplicationConfiguration;
2929
import org.gluu.casa.core.model.CustomScript;
30-
import org.gluu.casa.core.model.GluuOrganization;
31-
import org.gluu.casa.core.model.oxAuthConfiguration;
30+
import org.gluu.casa.core.model.JansOrganization;
31+
import org.gluu.casa.core.model.ASConfiguration;
3232
import org.gluu.casa.core.model.Person;
3333
import org.gluu.casa.misc.Utils;
3434
import org.gluu.casa.service.IPersistenceService;
@@ -57,9 +57,9 @@ public class PersistenceService implements IPersistenceService {
5757

5858
private String rootDn;
5959

60-
private JsonNode oxAuthConfDynamic;
60+
private JsonNode dynamicConfig;
6161

62-
private JsonNode oxAuthConfStatic;
62+
private JsonNode staticConfig;
6363

6464
private Set<String> personCustomObjectClasses;
6565

@@ -192,39 +192,39 @@ public String getPersonDn(String id) {
192192
}
193193

194194
public String getPeopleDn() {
195-
return jsonProperty(oxAuthConfStatic, "baseDn", "people");
195+
return jsonProperty(staticConfig, "baseDn", "people");
196196
}
197197

198198
public String getGroupsDn() {
199-
return jsonProperty(oxAuthConfStatic, "baseDn", "groups");
199+
return jsonProperty(staticConfig, "baseDn", "groups");
200200
}
201201

202202
public String getClientsDn() {
203-
return jsonProperty(oxAuthConfStatic, "baseDn", "clients");
203+
return jsonProperty(staticConfig, "baseDn", "clients");
204204
}
205205

206206
public String getScopesDn() {
207-
return jsonProperty(oxAuthConfStatic, "baseDn", "scopes");
207+
return jsonProperty(staticConfig, "baseDn", "scopes");
208208
}
209209

210210
public String getCustomScriptsDn() {
211-
return jsonProperty(oxAuthConfStatic, "baseDn", "scripts");
211+
return jsonProperty(staticConfig, "baseDn", "scripts");
212212
}
213213

214-
public GluuOrganization getOrganization() {
215-
return get(GluuOrganization.class, rootDn);
214+
public JansOrganization getOrganization() {
215+
return get(JansOrganization.class, rootDn);
216216
}
217217

218218
public String getIssuerUrl() {
219-
return jsonProperty(oxAuthConfDynamic, "issuer");
219+
return jsonProperty(dynamicConfig, "issuer");
220220
}
221221

222222
public Set<String> getPersonOCs() {
223223
return personCustomObjectClasses;
224224
}
225225

226226
public boolean isAdmin(String userId) {
227-
GluuOrganization organization = getOrganization();
227+
JansOrganization organization = getOrganization();
228228
List<String> dns = organization.getManagerGroups();
229229

230230
Person personMember = get(Person.class, getPersonDn(userId));
@@ -234,23 +234,23 @@ public boolean isAdmin(String userId) {
234234
}
235235

236236
public String getIntrospectionEndpoint() {
237-
return jsonProperty(oxAuthConfDynamic, "introspectionEndpoint");
237+
return jsonProperty(dynamicConfig, "introspectionEndpoint");
238238
}
239239

240240
public String getAuthorizationEndpoint() {
241-
return jsonProperty(oxAuthConfDynamic, "authorizationEndpoint");
241+
return jsonProperty(dynamicConfig, "authorizationEndpoint");
242242
}
243243

244244
public String getTokenEndpoint() {
245-
return jsonProperty(oxAuthConfDynamic, "tokenEndpoint");
245+
return jsonProperty(dynamicConfig, "tokenEndpoint");
246246
}
247247

248248
public String getUserInfoEndpoint() {
249-
return jsonProperty(oxAuthConfDynamic, "userInfoEndpoint");
249+
return jsonProperty(dynamicConfig, "userInfoEndpoint");
250250
}
251251

252252
public String getJwksUri() {
253-
return jsonProperty(oxAuthConfDynamic, "jwksUri");
253+
return jsonProperty(dynamicConfig, "jwksUri");
254254
}
255255

256256
@Produces
@@ -334,11 +334,11 @@ private boolean loadApplianceSettings(Properties properties) {
334334

335335
boolean success = false;
336336
try {
337-
loadOxAuthSettings(properties.getProperty("oxauth_ConfigurationEntryDN"));
338-
rootDn = "o=gluu";
337+
loadASSettings(properties.getProperty("jansAuth_ConfigurationEntryDN"));
338+
rootDn = "o=jans";
339339
success = true;
340340

341-
GluuConfiguration gluuConf = get(GluuConfiguration.class, jsonProperty(oxAuthConfStatic, "baseDn", "configuration"));
341+
GluuConfiguration gluuConf = get(GluuConfiguration.class, jsonProperty(staticConfig, "baseDn", "configuration"));
342342
cacheConfiguration = gluuConf.getCacheConfiguration();
343343
documentStoreConfiguration = gluuConf.getDocumentStoreConfiguration();
344344
} catch (Exception e) {
@@ -348,13 +348,13 @@ private boolean loadApplianceSettings(Properties properties) {
348348

349349
}
350350

351-
private void loadOxAuthSettings(String dn) throws Exception {
351+
private void loadASSettings(String dn) throws Exception {
352352

353-
oxAuthConfiguration conf = get(oxAuthConfiguration.class, dn);
354-
oxAuthConfDynamic = mapper.readTree(conf.getJansConfStatic());
355-
oxAuthConfStatic = mapper.readTree(conf.getJansConfDyn());
353+
ASConfiguration conf = get(ASConfiguration.class, dn);
354+
dynamicConfig = mapper.readTree(conf.getJansConfStatic());
355+
staticConfig = mapper.readTree(conf.getJansConfDyn());
356356

357-
personCustomObjectClasses = Optional.ofNullable(oxAuthConfDynamic.get("personCustomObjectClassList"))
357+
personCustomObjectClasses = Optional.ofNullable(dynamicConfig.get("personCustomObjectClassList"))
358358
.map(node -> {
359359
try {
360360
Set<String> ocs = new HashSet<>();

app/src/main/java/org/gluu/casa/core/model/oxAuthConfiguration.java renamed to app/src/main/java/org/gluu/casa/core/model/ASConfiguration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
@DataEntry
99
@ObjectClass("jansAppConf")
10-
public class oxAuthConfiguration extends Entry {
10+
public class ASConfiguration extends Entry {
1111

1212
@AttributeName
1313
private String jansConfDyn;

app/src/main/java/org/gluu/casa/plugins/authnmethod/rs/SecurityKey2EnrollingWS.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public Response sendRegistrationResult(String body, @PathParam("userid") String
114114
result = RegistrationCode.SUCCESS;
115115
}
116116
} else {
117-
logger.error("Verification has failed. See oxauth logs");
117+
logger.error("Verification has failed. See fido2 logs");
118118
result = RegistrationCode.FAILED;
119119
}
120120
} catch (Exception e) {

app/src/main/java/org/gluu/casa/plugins/authnmethod/service/MobilePhoneService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public List<VerifiedMobile> getVerifiedPhones(String userId) {
105105

106106
/**
107107
* Creates an instance of VerifiedMobile by looking up in the list of VerifiedPhones passed. If the item is not found
108-
* in the list, it means the user had already that phone added by means of another application, ie. oxTrust. In this
108+
* in the list, it means the user had already that phone added by means of another application, ie. admin-ui. In this
109109
* case the resulting object will not have properties like nickname, etc. Just the phone number
110110
* @param number Phone number (LDAP attribute "mobile" inside a user entry)
111111
* @param list List of existing phones enrolled. Ideally, there is an item here corresponding to the uid number passed

app/src/main/java/org/gluu/casa/plugins/authnmethod/service/U2fService.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public List<SecurityKey> getDevices(String userId, boolean active) {
7676

7777
/**
7878
* Triggers a registration request to a U2F endpoint and outputs the request message returned by the service in form of JSON
79-
* @param userName As required per org.gluu.oxauth.client.fido.u2f.RegistrationRequestService#startRegistration
79+
* @param userName As required per io.jans.as.client.fido.u2f.RegistrationRequestService#startRegistration
8080
* @param enrollmentCode A previously generated random code stored under user's LDAP entry
8181
* @return Json string representation
8282
* @throws Exception Network problem, De/Serialization error, ...
@@ -89,11 +89,11 @@ public String generateJsonRegisterMessage(String userName, String enrollmentCode
8989

9090
/**
9191
* Executes the finish registration step of the U2F service
92-
* @param userName As required per org.gluu.oxauth.client.fido.u2f.RegistrationRequestService#finishRegistration
92+
* @param userName As required per io.jans.as.client.fido.u2f.RegistrationRequestService#finishRegistration
9393
* @param response This is the Json response obtained in the web browser after calling the u2f.register function in Javascript
9494
*/
9595
public void finishRegistration(String userName, String response) {
96-
//first parameter is not used in current implementation, see: org.gluu.oxauth.ws.rs.fido.u2f.U2fRegistrationWS#finishRegistration
96+
//first parameter is not used in current implementation, see: io.jans.as.server.ws.rs.fido.u2f.U2fRegistrationWS#finishRegistration
9797
RegisterStatus status = registrationRequestService.finishRegistration(userName, response);
9898
logger.info("Response of finish registration: {}", status.getStatus());
9999
}

app/src/main/java/org/gluu/casa/timer/AuthnScriptsReloader.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public void jobToBeExecuted(JobExecutionContext context) {
150150
if (reload) {
151151
//"touch" main script so that it gets reloaded. This helps the script to keep the list of supported methods up-to-date
152152
try {
153-
logger.info("Touching main interception script to trigger reload by oxAuth...");
153+
logger.info("Touching main interception script to trigger reload by jans-auth-server...");
154154
script = persistenceService.getScript(ConfigurationHandler.DEFAULT_ACR);
155155
Map<String, String> moduleProperties = Utils.scriptModulePropertiesAsMap(script);
156156
ScriptLocationType locType = ScriptLocationType.getByValue(moduleProperties.get(LOCATION_TYPE_PROPERTY));

app/src/main/java/org/gluu/casa/ui/vm/admin/AuthnMethodsViewModel.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void init() {
4646

4747
Map<String, String> mappedAcrs = getSettings().getAcrPluginMap();
4848

49-
//This set contains entries associated to active acr methods in oxauth
49+
//This set contains entries associated to active acr methods in AS
5050
Set<String> serverAcrs = Optional.ofNullable(Utils.managedBean(ConfigurationHandler.class).retrieveAcrs())
5151
.orElse(Collections.emptySet());
5252

app/src/main/java/org/gluu/casa/ui/vm/user/SecurityKey2ViewModel.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ public void cancel() {
301301
try {
302302
/*
303303
* Remove the recently enrolled key. This is so because once the user touches
304-
* his key button, oxAuth creates the corresponding entry in LDAP, and if the
304+
* his key button, fido2 creates the corresponding entry in LDAP, and if the
305305
* user regrets adding the current key by not supplying a nickname (and thus
306306
* pressing cancel), we need to be obliterate the entry
307307
*/

app/src/main/java/org/gluu/casa/ui/vm/user/SecurityKeyViewModel.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public void cancel() {
168168
boolean success;
169169
try {
170170
/*
171-
Remove the recently enrolled key. This is so because once the user touches his key button, oxAuth creates the
171+
Remove the recently enrolled key. This is so because once the user touches his key button, jans-auth-server creates the
172172
corresponding entry in LDAP, and if the user regrets adding the current key by not supplying a nickname
173173
(and thus pressing cancel), we need to be obliterate the entry
174174
*/

plugins/account-linking/src/main/java/org/gluu/casa/plugins/accounts/service/AvailableProviders.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import java.util.stream.Collectors;
99

1010
import org.gluu.casa.misc.Utils;
11-
import org.gluu.config.oxtrust.LdapOxPassportConfiguration;
11+
import org.gluu.model.passport.PassportConfigurationEntry;
1212
import org.gluu.casa.plugins.accounts.pojo.Provider;
1313
import org.gluu.casa.service.IPersistenceService;
1414
import org.gluu.model.passport.PassportConfiguration;
@@ -67,8 +67,8 @@ private static List<Provider> retrieveProviders() {
6767
//skip uninteresting chars
6868
dn = dn.replaceFirst("[\\W]*=[\\W]*","");
6969

70-
List<org.gluu.model.passport.Provider> details = Optional.ofNullable(persistenceService.get(LdapOxPassportConfiguration.class, dn))
71-
.map(LdapOxPassportConfiguration::getPassportConfiguration).map(PassportConfiguration::getProviders)
70+
List<org.gluu.model.passport.Provider> details = Optional.ofNullable(persistenceService.get(PassportConfigurationEntry.class, dn))
71+
.map(PassportConfigurationEntry::getPassportConfiguration).map(PassportConfiguration::getProviders)
7272
.orElse(Collections.emptyList());
7373

7474
details = details.stream().filter(org.gluu.model.passport.Provider::isEnabled).collect(Collectors.toList());
@@ -85,7 +85,7 @@ private static List<Provider> retrieveProviders() {
8585
String logo = provider.getLogoImg();
8686
if (logo != null && !logo.startsWith("http")) {
8787
//It's not an absolute URL
88-
logo = "/oxauth/auth/passport/" + logo;
88+
logo = "/jans-auth/auth/passport/" + logo;
8989
}
9090
provider.setLogoImg(logo);
9191
providers.add(provider);

plugins/account-linking/src/main/java/org/gluu/config/oxtrust/LdapOxPassportConfiguration.java renamed to plugins/account-linking/src/main/java/org/gluu/model/passport/PassportConfigurationEntry.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
package org.gluu.config.oxtrust;
1+
package org.gluu.model.passport;
22

33
import io.jans.orm.model.base.Entry;
44
import io.jans.orm.annotation.AttributeName;
55
import io.jans.orm.annotation.DataEntry;
66
import io.jans.orm.annotation.JsonObject;
77
import io.jans.orm.annotation.ObjectClass;
88

9-
import org.gluu.model.passport.PassportConfiguration;
10-
119
@DataEntry
1210
@ObjectClass(value = "jansPassportConf")
13-
public class LdapOxPassportConfiguration extends Entry {
11+
public class PassportConfigurationEntry extends Entry {
1412

1513
private static final long serialVersionUID = -8451013277721189767L;
1614

plugins/cert-authn/src/main/java/org/gluu/casa/plugins/cert/service/CertService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ private void updateUserX509Certificates(CertPerson person, X509Certificate certi
327327
scimX509Cert.setValue(new String(Base64.getEncoder().encode(DEREncoded), StandardCharsets.UTF_8));
328328
scimX509Cert.setDisplay(display);
329329

330-
logger.debug("Updating user's oxTrustx509Certificate attribute");
330+
logger.debug("Updating user's x509Certificate attribute");
331331
stringCerts.add(mapper.writeValueAsString(scimX509Cert));
332332
person.setX509Certificates(stringCerts);
333333
}

plugins/cert-authn/src/main/java/org/gluu/casa/plugins/cert/vm/CertAuthenticationViewModel.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public void init() throws Exception {
129129

130130
logger.info("Preparing redirect for completion of authentication flow");
131131
String url = Utils.managedBean(IPersistenceService.class).getIssuerUrl();
132-
WebUtils.execRedirect(String.format("%s/oxauth/postlogin.htm", url), true);
132+
WebUtils.execRedirect(String.format("%s/jans-auth/postlogin.htm", url), true);
133133
}
134134

135135
}

plugins/client-authorizations/src/main/java/org/gluu/casa/plugins/consent/model/Token.java

+20-20
Original file line numberDiff line numberDiff line change
@@ -10,47 +10,47 @@
1010
public class Token extends Entry {
1111

1212
@AttributeName(name = "tknCde")
13-
private String oxAuthTokenCode;
13+
private String tokenCode;
1414

1515
@AttributeName(name = "clnId")
16-
private String oxAuthClientId;
16+
private String clientId;
1717

1818
@AttributeName(name = "tknTyp")
19-
private String oxAuthTokenType;
19+
private String tokenType;
2020

2121
@AttributeName(name = "usrId")
22-
private String oxAuthUserId;
22+
private String userId;
2323

24-
public String getOxAuthTokenCode() {
25-
return oxAuthTokenCode;
24+
public String getTokenCode() {
25+
return tokenCode;
2626
}
2727

28-
public String getOxAuthClientId() {
29-
return oxAuthClientId;
28+
public String getClientId() {
29+
return clientId;
3030
}
3131

32-
public String getOxAuthTokenType() {
33-
return oxAuthTokenType;
32+
public String getTokenType() {
33+
return tokenType;
3434
}
3535

36-
public String getOxAuthUserId() {
37-
return oxAuthUserId;
36+
public String getUserId() {
37+
return userId;
3838
}
3939

40-
public void setOxAuthTokenCode(String oxAuthTokenCode) {
41-
this.oxAuthTokenCode = oxAuthTokenCode;
40+
public void setTokenCode(String tokenCode) {
41+
this.tokenCode = tokenCode;
4242
}
4343

44-
public void setOxAuthClientId(String v) {
45-
this.oxAuthClientId = v;
44+
public void setClientId(String v) {
45+
this.clientId = v;
4646
}
4747

48-
public void setOxAuthTokenType(String v) {
49-
this.oxAuthTokenType = v;
48+
public void setTokenType(String v) {
49+
this.tokenType = v;
5050
}
5151

52-
public void setOxAuthUserId(String oxAuthUserId) {
53-
this.oxAuthUserId = oxAuthUserId;
52+
public void setUserId(String userId) {
53+
this.userId = userId;
5454
}
5555

5656
}

0 commit comments

Comments
 (0)