Skip to content

UID2-5482 Use handleWithAudit for auth middleware#173

Merged
cYKatherine merged 7 commits intomainfrom
kcc-UID2-5482-audit-logging-in-optout
Jun 3, 2025
Merged

UID2-5482 Use handleWithAudit for auth middleware#173
cYKatherine merged 7 commits intomainfrom
kcc-UID2-5482-audit-logging-in-optout

Conversation

@cYKatherine
Copy link
Contributor

No description provided.

@cYKatherine cYKatherine force-pushed the kcc-UID2-5482-audit-logging-in-optout branch from 4dabb1c to 38f7d2c Compare May 29, 2025 06:00
public static final String OptOutDeleteExpiredProp = "optout_delete_expired";
public static final String PartnersConfigPathProp = "partners_config_path";
public static final String PartnersMetadataPathProp = "partners_metadata_path";
public static final String EnableAuditLoggingProp = "enable_audit_logging";
Copy link

Choose a reason for hiding this comment

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

I think we want the Auditlog to be enabled always for optout. So this config may become redundant later.

@cYKatherine cYKatherine self-assigned this Jun 2, 2025
@cYKatherine cYKatherine force-pushed the kcc-UID2-5482-audit-logging-in-optout branch from e02b247 to 440476a Compare June 3, 2025 00:18
@cYKatherine cYKatherine force-pushed the kcc-UID2-5482-audit-logging-in-optout branch from 440476a to f632b86 Compare June 3, 2025 00:18
final String jwtAudience = jsonConfig.getString(Const.Config.OptOutUrlProp);
final String jwtIssuer = jsonConfig.getString(Const.Config.CorePublicUrlProp);
Boolean enforceJwt = jsonConfig.getBoolean(Const.Config.EnforceJwtProp, true);
Boolean enforceJwt = jsonConfig.getBoolean(Const.Config.EnforceJwtProp, false);
Copy link

Choose a reason for hiding this comment

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

is this intentional to keep default value false ?

Handler<RoutingContext> handler = internalAuth.handleWithAudit(nextHandler);
handler.handle(routingContext);
verifyNoInteractions(nextHandler);
verify(routingContext).fail(401);
Copy link

Choose a reason for hiding this comment

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

can you add a positive test case as well ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@cYKatherine cYKatherine merged commit f04f6f2 into main Jun 3, 2025
4 checks passed
@cYKatherine cYKatherine deleted the kcc-UID2-5482-audit-logging-in-optout branch June 3, 2025 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants