Skip to content

DDCNL-12161: TAI - Add in auth caching#425

Open
askar-makkunnath wants to merge 5 commits into
mainfrom
DDCNL-12161
Open

DDCNL-12161: TAI - Add in auth caching#425
askar-makkunnath wants to merge 5 commits into
mainfrom
DDCNL-12161

Conversation

@askar-makkunnath

@askar-makkunnath askar-makkunnath commented Jul 20, 2026

Copy link
Copy Markdown
Contributor
  • Unit tests passing
  • Coverage reached
  • Acceptance tests passing
  • Reviewed


given (Encrypter with Decrypter) = crypto

def put[T: Writes](cacheId: CacheId, dataKey: DataKey[T], data: T): Future[(String, String)] =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think put should also have recoverWith like get wher ewe log an error and move on, now it would fail bcos of mongo blip

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I kept this aligned with Pertax and FANDF, where put() doesn't recover. If we want to make cache writes best-effort, I'd prefer handling it in AuthAction around the putSession call rather than changing the generic repository.

}
.recover {
case x: NoActiveSession =>
logger.error("Failed to authorise: " + x.reason)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we log it as error, because session timeout, in pertax we dont log anything for these error, worth keeping same pattern

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated.

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