Skip to content

Commit

Permalink
Merge branch 'develop' into well-known-scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
federicaagostini committed Sep 15, 2023
2 parents a31459c + 986d684 commit df7ba43
Show file tree
Hide file tree
Showing 83 changed files with 2,517 additions and 449 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Sonar analysis

on:
on:
push:
branches:
- develop
pull_request:
types: [opened, edited, reopened, synchronize]

Expand Down Expand Up @@ -28,7 +31,7 @@ jobs:
- name: Sonar analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_VIANELLO }}
run: mvn -B -U install sonar:sonar
-Dsonar.projectKey=indigo-iam_iam
-Dsonar.organization=indigo-iam
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# INDIGO Identity and Access Management (IAM) service

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3496834.svg)](https://doi.org/10.5281/zenodo.3496834)
[![travis-build-tatus](https://travis-ci.org/indigo-iam/iam.svg?branch=develop)](https://travis-ci.org/indigo-iam/iam)
[![build & packaging](https://github.com/indigo-iam/iam/actions/workflows/maven.yml/badge.svg?branch=master&event=push)](https://github.com/indigo-iam/iam/actions/workflows/maven.yml)
[![sonarqube-qg](https://sonarcloud.io/api/project_badges/measure?project=indigo-iam_iam&metric=alert_status)](https://sonarcloud.io/dashboard?id=indigo-iam_iam)
[![sonarqube-coverage](https://sonarcloud.io/api/project_badges/measure?project=indigo-iam_iam&metric=coverage)](https://sonarcloud.io/dashboard?id=indigo-iam_iam)
[![sonarqube-maintainability](https://sonarcloud.io/api/project_badges/measure?project=indigo-iam_iam&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=indigo-iam_iam)
Expand Down
26 changes: 13 additions & 13 deletions iam-common/pom.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:ns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>it.infn.mw</groupId>
<groupId>it.infn.mw.iam-parent</groupId>
<artifactId>iam-parent</artifactId>
<version>1.8.3</version>
</parent>

<groupId>it.infn.mw.iam-common</groupId>
<artifactId>iam-common</artifactId>
<packaging>jar</packaging>

Expand All @@ -18,8 +18,16 @@
<properties>
<spring-boot.build-image.skip>true</spring-boot.build-image.skip>
</properties>
<build>

<dependencies>
<dependency>
<groupId>it.infn.mw.iam-persistence</groupId>
<artifactId>iam-persistence</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
Expand All @@ -32,12 +40,4 @@
</plugins>
</pluginManagement>
</build>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>iam-persistence</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
119 changes: 62 additions & 57 deletions iam-login-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
limitations under the License.
-->
<project xmlns:ns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>it.infn.mw</groupId>
<groupId>it.infn.mw.iam-parent</groupId>
<artifactId>iam-parent</artifactId>
<version>1.8.3</version>
</parent>

<groupId>it.infn.mw.iam-login-service</groupId>
<artifactId>iam-login-service</artifactId>
<packaging>war</packaging>

Expand All @@ -44,7 +44,7 @@

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<groupId>it.infn.mw.iam-persistence</groupId>
<artifactId>iam-persistence</artifactId>
<version>${project.version}</version>
<exclusions>
Expand All @@ -56,7 +56,7 @@
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<groupId>it.infn.mw.iam-common</groupId>
<artifactId>iam-common</artifactId>
<version>${project.version}</version>
</dependency>
Expand Down Expand Up @@ -279,12 +279,17 @@
<!-- SAML -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<artifactId>bcpkix-jdk18on</artifactId>
</dependency>

<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</dependency>

<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcutil-jdk18on</artifactId>
</dependency>

<dependency>
Expand Down Expand Up @@ -392,6 +397,7 @@
</dependency>

</dependencies>

<build>
<finalName>iam-login-service</finalName>
<resources>
Expand All @@ -406,6 +412,54 @@
<directory>src/main/webapp</directory>
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<configuration>
<header>${project.parent.basedir}/LICENSE</header>
<excludes>
<exclude>.jslintrc</exclude>
<exclude>**/*.vm</exclude>
<exclude>**/*.tag</exclude>
<exclude>**/Dockerfile</exclude>
<exclude>**/Dockerfile.prod</exclude>
<exclude>**/resources/iam/js/datepicker/*.js</exclude>
<exclude>**/resources/js/lib/*.js</exclude>
<exclude>**/resources/js/*.js</exclude>
<exclude>**/resources/template/*.html</exclude>
<exclude>**/resources/iam-banner.txt</exclude>
<exclude>**/resources/css/*.css</exclude>
<exclude>**/resources/iam/css/ionicons/ionicons.min.css</exclude>
<exclude>**/*.template.html</exclude>
<exclude>**/WEB-INF/views/*.jsp</exclude>
<exclude>**/*.jks</exclude>
<exclude>**/*.pem</exclude>
<exclude>**/*.p12</exclude>
<exclude>**/*.crt</exclude>
<exclude>**/*.key</exclude>
<exclude>**/*.jwks</exclude>
<exclude>**/*.factorypath</exclude>
<exclude>**/*.ftl</exclude>
<exclude>**/*.woff</exclude>
<exclude>**/*.woff2</exclude>
<exclude>**/ddl.sql</exclude>
</excludes>
<useDefaultExcludes>true</useDefaultExcludes>
</configuration>
<executions>
<execution>
<id>check-headers</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -481,54 +535,5 @@
</configuration>
</plugin>
</plugins>

<pluginManagement>
<plugins>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<configuration>
<header>${project.parent.basedir}/LICENSE</header>
<excludes>
<exclude>.jslintrc</exclude>
<exclude>**/*.vm</exclude>
<exclude>**/*.tag</exclude>
<exclude>**/Dockerfile</exclude>
<exclude>**/Dockerfile.prod</exclude>
<exclude>**/resources/iam/js/datepicker/*.js</exclude>
<exclude>**/resources/js/lib/*.js</exclude>
<exclude>**/resources/js/*.js</exclude>
<exclude>**/resources/template/*.html</exclude>
<exclude>**/resources/iam-banner.txt</exclude>
<exclude>**/resources/css/*.css</exclude>
<exclude>**/resources/iam/css/ionicons/ionicons.min.css</exclude>
<exclude>**/*.template.html</exclude>
<exclude>**/WEB-INF/views/*.jsp</exclude>
<exclude>**/*.jks</exclude>
<exclude>**/*.pem</exclude>
<exclude>**/*.p12</exclude>
<exclude>**/*.crt</exclude>
<exclude>**/*.key</exclude>
<exclude>**/*.jwks</exclude>
<exclude>**/*.factorypath</exclude>
<exclude>**/*.ftl</exclude>
<exclude>**/*.woff</exclude>
<exclude>**/*.woff2</exclude>
<exclude>**/ddl.sql</exclude>
</excludes>
<useDefaultExcludes>true</useDefaultExcludes>
</configuration>
<executions>
<execution>
<id>check-headers</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@

import org.mitre.discovery.web.DiscoveryEndpoint;
import org.mitre.oauth2.web.CorsFilter;
import org.mitre.oauth2.web.OAuthConfirmationController;
import org.mitre.openid.connect.web.DynamicClientRegistrationEndpoint;
import org.mitre.openid.connect.web.JWKSetPublishingEndpoint;
import org.mitre.oauth2.web.OAuthConfirmationController;
import org.mitre.openid.connect.web.RootController;
import org.mitre.openid.connect.web.UserInfoEndpoint;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.h2.H2ConsoleAutoConfiguration;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
Expand Down Expand Up @@ -77,7 +78,7 @@
@ComponentScan.Filter(type=FilterType.ASSIGNABLE_TYPE,
value=OAuthConfirmationController.class)
})

@EnableCaching
@EnableAutoConfiguration(
exclude = {
SecurityAutoConfiguration.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,12 @@ public void linkX509Certificate(Principal authenticatedUser,

Optional<IamX509Certificate> linkedCert = userAccount.getX509Certificates()
.stream()
.filter(c -> c.getSubjectDn().equals(x509Credential.getSubject()))
.filter(c -> c.getSubjectDn().equals(x509Credential.getSubject()) && c.getIssuerDn().equals(x509Credential.getIssuer()))
.findAny();

if (linkedCert.isPresent()) {

linkedCert.ifPresent(c -> {
c.setSubjectDn(x509Credential.getSubject());
c.setIssuerDn(x509Credential.getIssuer());
c.setCertificate(x509Credential.getCertificateChainPemString());
c.setLastUpdateTime(new Date());
});
Expand Down
Loading

0 comments on commit df7ba43

Please sign in to comment.