Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kc change #1062

Merged
merged 18 commits into from
Jun 30, 2021
Merged

Kc change #1062

merged 18 commits into from
Jun 30, 2021

Conversation

nolantellis
Copy link
Contributor

No description provided.

boolean isExistingSession = existingSession == null ? false
: existingSession.getAttribute("USER") == null ? false : true;

System.out.println("Auth-path=" + requestPath);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this

uri = new URI(requestUriStr);
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to log exception as error.


@Override
public String getFilterName() {
// TODO Auto-generated method stub
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Minor] remove auto-generated comments

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will delete this file. Not used


@Override
public void init(FilterConfig filterConfig) throws ServletException {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Minor] Remove blank lines.

boolean isExistingSession = existingSession == null ? false
: existingSession.getAttribute("USER") == null ? false : true;

System.out.println("Auth-path=" + requestPath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use logger rather than System.out

switch (name) {
case "keycloak.config.skipPattern":
return null;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Minor] remove blank lines


File f = new File(System.getProperty("karaf.etc"), "/config/" + "keycloak.json");
try {
FileInputStream keyCloakJsonFile = new FileInputStream(f);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use try-with-resources for IO resources

String userName = token.getPreferredUsername();
userName = userName == null ? token.getEmail() : userName;
String email = token.getEmail();
String givenName = token.getGivenName();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two statements (givenName and lastName retrieval) can be moved after line 96 as only utilised there, or used in-line on line 97 directly. Reduces scope, and provides a slight performance improvement in the alternate use case (when userType != null).

Copy link
Contributor

@fsmicdev fsmicdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor changes, as indicated.

site.properties Outdated Show resolved Hide resolved
site.properties Outdated Show resolved Hide resolved
Comment on lines 139 to 147
<bundle>mvn:org.keycloak/keycloak-servlet-filter-adapter/14.0.0</bundle>
<bundle>mvn:org.keycloak/keycloak-core/14.0.0</bundle>
<bundle>mvn:org.keycloak/keycloak-common/14.0.0</bundle>
<bundle>mvn:org.keycloak/keycloak-adapter-spi/14.0.0</bundle>
<bundle>mvn:org.keycloak/keycloak-servlet-adapter-spi/14.0.0</bundle>
<bundle>mvn:org.keycloak/keycloak-adapter-core/14.0.0</bundle>
<bundle>mvn:org.keycloak/keycloak-servlet-filter-adapter/14.0.0</bundle>
<bundle>mvn:org.keycloak/keycloak-authz-client/14.0.0</bundle>
<bundle>mvn:org.keycloak/keycloak-osgi-adapter/14.0.0</bundle>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the keycloak.version property in ApromoreCore/pom.xml and use ${keycloak.version} instead of 14.0.0

core-assemblies/apromore-core/pom.xml Outdated Show resolved Hide resolved
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-servlet-filter-adapter</artifactId>
<version>14.0.0</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update keycloak.version in ApromoreCore/pom.xml and use ${keycloak.version}

<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-osgi-adapter</artifactId>
<version>14.0.0</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update keycloak.version in ApromoreCore/pom.xml and use ${keycloak.version}

@nolantellis nolantellis requested a review from raboczi June 30, 2021 02:03
@raboczi raboczi merged commit 36fc397 into development Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants