Skip to content

Commit

Permalink
IS-91 Made sure multiple log entries were not produced from the same …
Browse files Browse the repository at this point in the history
…base class (#92)
  • Loading branch information
martin-lindstrom authored Dec 9, 2024
1 parent bdc386d commit d9e0865
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 22 deletions.
4 changes: 2 additions & 2 deletions autoconfigure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>se.swedenconnect.spring.saml.idp</groupId>
<artifactId>spring-saml-idp-parent</artifactId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
</parent>

<name>Sweden Connect :: Spring SAML Identity Provider :: Spring Boot Autoconfigure module</name>
Expand Down Expand Up @@ -106,7 +106,7 @@
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-boot-starter</artifactId>
<version>3.39.0</version>
<version>3.40.1</version>
<optional>true</optional>
</dependency>

Expand Down
31 changes: 25 additions & 6 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,49 @@

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/se.swedenconnect.spring.saml.idp/spring-saml-idp/badge.svg)](https://maven-badges.herokuapp.com/maven-central/se.swedenconnect.spring.saml.idp/spring-saml-idp)

### Version 2.3.1

Date:

- When using more than one audit logger, multiple log entries were produced from the same base class. This has been
fixed.

### Version 2.3.0

Date: 2024-12-08

- The latest version of the [credentials-support](https://docs.swedenconnect.se/credentials-support/) is now used by the library. Using this library, the [Credentials Bundles](https://docs.swedenconnect.se/credentials-support/#the-bundles-concept) concept can by used for a better was of configuring credentials.
- The latest version of the [credentials-support](https://docs.swedenconnect.se/credentials-support/) is now used by the
library. Using this library,
the [Credentials Bundles](https://docs.swedenconnect.se/credentials-support/#the-bundles-concept) concept can by used
for a better was of configuring credentials.

- New audit entries for credential monitoring are published, if credential monitoring is being used.

### Version 2.2.1

Date: 2024-11-21

- Support for the eIDAS (optional) attributes Nationality, CountryOfResidence, CountryOfBirth and TownOfBirth was added to attribute conversion logic. This fix only applies to IdP:s that proxy assertions from eIDAS.
- Support for the eIDAS (optional) attributes Nationality, CountryOfResidence, CountryOfBirth and TownOfBirth was added
to attribute conversion logic. This fix only applies to IdP:s that proxy assertions from eIDAS.

- When configuring an HTTPS Metadata Provider it is now possible to configure it with a `https-trust-bundle` to specify which root certificates that are accepted during TLS server certificate validation. See [Metadata Provider Configuration](https://docs.swedenconnect.se/saml-identity-provider/configuration.html#metadata-provider-configuration).
- When configuring an HTTPS Metadata Provider it is now possible to configure it with a `https-trust-bundle` to specify
which root certificates that are accepted during TLS server certificate validation.
See [Metadata Provider Configuration](https://docs.swedenconnect.se/saml-identity-provider/configuration.html#metadata-provider-configuration).

### Version 2.2.0

Date: 2024-10-04

- The [Saml2ServiceProviderFilter](https://github.com/swedenconnect/saml-identity-provider/blob/main/saml-identity-provider/src/main/java/se/swedenconnect/spring/saml/idp/authnrequest/Saml2ServiceProviderFilter.java) interface was introduced. By declaring a bean of this type, an implementation may add additional restrictions on which Service Provider that are allowed to send requests.
-

The [Saml2ServiceProviderFilter](https://github.com/swedenconnect/saml-identity-provider/blob/main/saml-identity-provider/src/main/java/se/swedenconnect/spring/saml/idp/authnrequest/Saml2ServiceProviderFilter.java)
interface was introduced. By declaring a bean of this type, an implementation may add additional restrictions on which
Service Provider that are allowed to send requests.

- (embarrassing) We started publishing release notes ...
- (embarrassing) We started publishing release notes ...

----

Copyright &copy; 2022-2024, [Myndigheten för digital förvaltning - Swedish Agency for Digital Government (DIGG)](http://www.digg.se). Licensed under version 2.0 of the [Apache License](http://www.apache.org/licenses/LICENSE-2.0).
Copyright &copy;
2022-2024, [Myndigheten för digital förvaltning - Swedish Agency for Digital Government (DIGG)](http://www.digg.se).
Licensed under version 2.0 of the [Apache License](http://www.apache.org/licenses/LICENSE-2.0).
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>se.swedenconnect.spring.saml.idp</groupId>
<artifactId>spring-saml-idp-parent</artifactId>
<packaging>pom</packaging>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>

<name>Sweden Connect :: Spring SAML Identity Provider :: Parent POM</name>
<description>Parent POM for Spring SAML Identity Provider libraries</description>
Expand Down
2 changes: 1 addition & 1 deletion saml-identity-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>se.swedenconnect.spring.saml.idp</groupId>
<artifactId>spring-saml-idp-parent</artifactId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
</parent>

<name>Sweden Connect :: Spring SAML Identity Provider :: Core Library</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public final class Saml2IdentityProviderVersion {

private static final int MAJOR = 2;
private static final int MINOR = 3;
private static final int PATCH = 0;
private static final int PATCH = 1;

/**
* Global serialization value for SAML Identity Provider classes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
*/
package se.swedenconnect.spring.saml.idp.audit.repository;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.boot.actuate.audit.AuditEventRepository;

import java.io.IOException;
import java.nio.file.Path;
import java.time.Instant;
Expand All @@ -25,11 +29,6 @@
import java.util.logging.Level;
import java.util.logging.Logger;

import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.boot.actuate.audit.AuditEventRepository;

import lombok.extern.slf4j.Slf4j;

/**
* A write-only {@link AuditEventRepository} that writes audit events to a file.
*
Expand Down Expand Up @@ -85,6 +84,7 @@ public FileBasedAuditEventRepository(
@Override
public void addEvent(final AuditEvent event) {
try {
log.debug("Audit logging event '{}' for principal '{}' ...", event.getType(), event.getPrincipal());
this.auditLogger.log(Level.INFO, this.eventMapper.write(event));
}
catch (final Throwable e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@ public FilteringAuditEventRepository(final Predicate<AuditEvent> filter) {
public final void add(final AuditEvent event) {
if (event != null) {
if (this.filter.test(event)) {
log.debug("Audit logging event '{}' for principal '{}' ...", event.getType(), event.getPrincipal());
this.addEvent(event);
}
else {
log.debug("Audit event {} not logged - filter rules excludes it", event.getType());
log.trace("Audit event {} not logged - filter rules excludes it", event.getType());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.List;
import java.util.function.Predicate;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.boot.actuate.audit.AuditEventRepository;
import org.springframework.boot.actuate.audit.InMemoryAuditEventRepository;
Expand All @@ -30,6 +31,7 @@
*
* @author Martin Lindström
*/
@Slf4j
public class MemoryBasedAuditEventRepository extends FilteringAuditEventRepository {

public static final int DEFAULT_CAPACITY = 1000;
Expand Down Expand Up @@ -70,6 +72,7 @@ public MemoryBasedAuditEventRepository(final Predicate<AuditEvent> filter, final
/** {@inheritDoc} */
@Override
protected void addEvent(final AuditEvent event) {
log.debug("Audit logging event '{}' for principal '{}' ...", event.getType(), event.getPrincipal());
this.repository.add(event);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public RedisListAuditEventRepository(final StringRedisTemplate redisTemplate, fi
@Override
protected void addEvent(final AuditEvent event) {
try {
log.debug("Audit logging event '{}' for principal '{}' ...", event.getType(), event.getPrincipal());
this.listOps.rightPush(this.keyName, this.eventMapper.write(event));
}
catch (final Throwable e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public RedissonTimeSeriesAuditEventRepository(final RedissonClient client, final
@Override
protected void addEvent(final AuditEvent event) {
try {
log.debug("Audit logging event '{}' for principal '{}' ...", event.getType(), event.getPrincipal());
this.client.getTimeSeries(this.tsName)
.add(event.getTimestamp().toEpochMilli(), this.eventMapper.write(event));
}
Expand Down
2 changes: 1 addition & 1 deletion samples/client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>se.swedenconnect.spring.saml.idp</groupId>
<artifactId>spring-saml-idp-samples-parent</artifactId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
</parent>

<name>Sweden Connect :: Spring SAML Identity Provider :: Samples :: Client Application</name>
Expand Down
2 changes: 1 addition & 1 deletion samples/demo-boot-idp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>se.swedenconnect.spring.saml.idp</groupId>
<artifactId>spring-saml-idp-samples-parent</artifactId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
</parent>

<name>Sweden Connect :: Spring SAML Identity Provider :: Samples :: Spring Boot Starter Demo Application</name>
Expand Down
2 changes: 1 addition & 1 deletion samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>se.swedenconnect.spring.saml.idp</groupId>
<artifactId>spring-saml-idp-parent</artifactId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
</parent>

<name>Sweden Connect :: Spring SAML Identity Provider :: Samples :: Parent POM</name>
Expand Down
2 changes: 1 addition & 1 deletion starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>se.swedenconnect.spring.saml.idp</groupId>
<artifactId>spring-saml-idp-parent</artifactId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
</parent>

<name>Sweden Connect :: Spring SAML Identity Provider :: Spring Boot Starter</name>
Expand Down

0 comments on commit d9e0865

Please sign in to comment.