Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add App Check tests in GenerativeModelTests #12590

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

andrewheard
Copy link
Contributor

Added tests to verify that an App Check header is added to requests when an AppCheckInterop instance is provided. All the previously existing tests verify that the header is not added (nil).

#no-changelog

@andrewheard andrewheard marked this pull request as ready for review March 19, 2024 21:48
@andrewheard andrewheard requested a review from paulb777 March 19, 2024 21:49
Copy link
Member

@paulb777 paulb777 left a comment

Choose a reason for hiding this comment

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

Where is the app check token value tested?

@andrewheard
Copy link
Contributor Author

Where is the app check token value tested?

@paulb777 It's in the httpRequestHandler. It's indirect but I can't think of a better way to inspect the value when testing this class.

XCTAssertEqual(request.value(forHTTPHeaderField: "X-Firebase-AppCheck"), appCheckToken)

Could potentially have some unit tests for GenerativeAIService instead (or in addition to these).

@paulb777
Copy link
Member

I see. LGTM.

@andrewheard andrewheard merged commit 2aece5b into vertex-ai Mar 20, 2024
36 checks passed
@andrewheard andrewheard deleted the ah/vertex-ai-app-check branch March 20, 2024 14:11
@firebase firebase locked and limited conversation to collaborators Apr 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants