Use logger class and send App Check dummy token in header#8591
Use logger class and send App Check dummy token in header#8591
Conversation
🦋 Changeset detectedLatest commit: 9e8ef56 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Analysis Report 1Affected Products
Test Logs |
DellaBitta
left a comment
There was a problem hiding this comment.
Looks like you can drop the base64 import.
Size Report 1Affected Products
Test Logs |
Thanks, got it. |
App Check's
getToken()should never throw, but in case of an error getting a valid App Check token, it fills in the "token" field with a standard dummy token, and adds an "error" field. The backend needs to receive these dummy tokens in the header so the developer can track failed requests. Right now we just don't send them. This change sends the dummy token, and logs a warning if an error is found.I also realized I forgot to include the standard
loggerAPI in VertexAI so I added it. This is a wrapper aroundconsoleused across all products that adds a product name prefix and also enables the globalsetLogLevel()to apply to any console messages called through this wrapper.