Skip to content

Commit

Permalink
Add "Last-Modified" header to OIDC metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
guimard committed Dec 2, 2024
1 parent 57caab8 commit c71eb0b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ env:
VERSION: 2.20.1
PGVERSION: 15
DEBIANRELEASE: bookworm
DOCKERREVISION: 1
DOCKERREVISION: 2

on:
push:
Expand Down
7 changes: 5 additions & 2 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Changes

## v2.20.1-0
## v2.20.1-2
* Add "Last-Modified" header for OIDC metadata

## v2.20.1-1 _(2024-11-19)_
* Update to 2.20.1

## v2.20.0-4 _(2024A-11-14)_
## v2.20.0-4 _(2024-11-14)_

* Fix SAML regression
* Fix Captcha rule bug
Expand Down
8 changes: 5 additions & 3 deletions portal/metadata-ttl.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
--- a/usr/share/perl5/Lemonldap/NG/Portal/Issuer/OpenIDConnect.pm
+++ b/usr/share/perl5/Lemonldap/NG/Portal/Issuer/OpenIDConnect.pm
@@ -2704,8 +2704,11 @@ sub logout {
@@ -2704,8 +2704,13 @@ sub logout {
sub metadata {
my ( $self, $req ) = @_;
$req->data->{dropCsp} = 1 if $self->conf->{oidcDropCspHeaders};
+ my %args;
+ $args{ttl} = $self->conf->{oidcServiceMetadataTtl}
+ if $self->conf->{oidcServiceMetadataTtl};
+ if ( $self->conf->{oidcServiceMetadataTtl} ) {
+ $args{ttl} = $self->conf->{oidcServiceMetadataTtl};
+ $args{date} = $self->conf->{cfgDate};
+ }
return $self->p->sendJSONresponse( $req,
- $self->metadataDoc( $self->get_issuer($req) ) );
+ $self->metadataDoc( $self->get_issuer($req) ), %args );
Expand Down
8 changes: 5 additions & 3 deletions uwsgi-portal/metadata-ttl.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
--- a/usr/share/perl5/Lemonldap/NG/Portal/Issuer/OpenIDConnect.pm
+++ b/usr/share/perl5/Lemonldap/NG/Portal/Issuer/OpenIDConnect.pm
@@ -2704,8 +2704,11 @@ sub logout {
@@ -2704,8 +2704,13 @@ sub logout {
sub metadata {
my ( $self, $req ) = @_;
$req->data->{dropCsp} = 1 if $self->conf->{oidcDropCspHeaders};
+ my %args;
+ $args{ttl} = $self->conf->{oidcServiceMetadataTtl}
+ if $self->conf->{oidcServiceMetadataTtl};
+ if ( $self->conf->{oidcServiceMetadataTtl} ) {
+ $args{ttl} = $self->conf->{oidcServiceMetadataTtl};
+ $args{date} = $self->conf->{cfgDate};
+ }
return $self->p->sendJSONresponse( $req,
- $self->metadataDoc( $self->get_issuer($req) ) );
+ $self->metadataDoc( $self->get_issuer($req) ), %args );
Expand Down

0 comments on commit c71eb0b

Please sign in to comment.