Skip to content

Commit fd94fd0

Browse files
committed
Add/update JavaDoc/comments
1 parent 7ffb5c7 commit fd94fd0

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/main/java/io/cos/cas/osf/authentication/support/OsfInstitutionUtils.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import java.util.Map;
1515

1616
/**
17-
* This is {@link OsfInstitutionUtils}.
17+
* This is {@link OsfInstitutionUtils}, which provides helper methods supporting the institution SSO login flow.
1818
*
1919
* @author Longze Chen
2020
* @since 21.0.0
@@ -54,13 +54,16 @@ public static Map<String, String> getInstitutionLoginUrlMap(
5454
for (final OsfInstitution institution: institutionList) {
5555
final SsoAvailability ssoAvailability = institution.getSsoAvailability();
5656
if (ssoAvailability == null) {
57+
// Catch a rare exception case where OSF DB has changed the choices of the field
58+
// `sso_availability` in table `osf_institution` without syncing with CAS.
5759
LOGGER.error(
5860
"Skipped due to invalid SSO Availability: [institutionId={}]",
5961
institution.getInstitutionId()
6062
);
6163
continue;
6264
}
6365
if (!ssoAvailability.isPublic()) {
66+
// Hide institutions of which SSO Availability is not Public
6467
LOGGER.debug(
6568
"Skipped because SSO Availability is not public: [institutionId={}, ssoAvailability={}]",
6669
institution.getInstitutionId(),

src/main/java/io/cos/cas/osf/authentication/support/SsoAvailability.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
package io.cos.cas.osf.authentication.support;
22

33
/**
4-
* This is {@link SsoAvailability}.
4+
* This is {@link SsoAvailability}, which is used in {@link io.cos.cas.osf.model.OsfInstitution}
5+
* to map to the types/choices of its counterpart in the OSF model.
56
*
67
* @author Longze Chen
78
* @since 26.1.0
@@ -40,6 +41,9 @@ public static SsoAvailability getType(final String id) throws IllegalArgumentExc
4041
throw new IllegalArgumentException("No matching type for id " + id);
4142
}
4243

44+
/**
45+
* @return whether the enum type is {@link SsoAvailability#PUBLIC}.
46+
*/
4347
public boolean isPublic () {
4448
return SsoAvailability.PUBLIC.equals(this);
4549
}

0 commit comments

Comments
 (0)