Remove enabled? check in anthropic/client.rb

What does this MR do and why?

This MR removes an abundant enabled? check, where we check whether we have a valid access token. We already check this before the Duo Chat window is opened, so having another check here is abundant. When making the actual request, we also send over the token, but have to request it again, so memoizing it here has no benefit.

A possible edge case we could run into is that we have an expired token that failed to refresh 3 days in a row, but we have valid permissions still stored. Then we would be able to open chat, and make the request with the expired token. AIGW would then deny this request, so we would still not be able to use the AIGW with an invalid/expired token.

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #546563 (closed)

Edited by Roy Zwambag

Merge request reports

Loading