Skip to content

[Site Admin] Add e2e tests for siteadmin apis#5694

Merged
tung2744 merged 7 commits intoauthgear:mainfrom
carmenlau:siteadmin-e2e
Apr 30, 2026
Merged

[Site Admin] Add e2e tests for siteadmin apis#5694
tung2744 merged 7 commits intoauthgear:mainfrom
carmenlau:siteadmin-e2e

Conversation

@carmenlau
Copy link
Copy Markdown
Contributor

ref DEV-3518

Comment on lines +14 to +15
X-Authgear-Session-Valid: "true"
X-Authgear-User-Id: "00000000-0000-0000-0000-000000000001"
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 thought we need to provide a access token here?

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.

The test setup is simplified. It uses WEB_SDK_SESSION_TYPE=cookie and assumes the server is behind the resolver proxy, so an access token is not needed.

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 was actually thinking, did we exposed a security risk in our helm chart if webSDKSessionType is set to cookies? It seems in portal when webSDKSessionType is set to cookies, we automatically setup a nginx proxy and expose the nginx instead. However, in siteadmin, looks like we do not have such setup. Therefore, if the user set webSDKSessionType to cookies, the api caller can claim himself as anyone? Did I missed anything?

Copy link
Copy Markdown
Contributor Author

@carmenlau carmenlau Apr 30, 2026

Choose a reason for hiding this comment

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

Yes, good catch. Users should never set webSDKSessionType to cookie, so maybe we should hardcode the env and remove webSDKSessionType from the helm chart for site admin.

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.

What if we remove the SITEADMIN_AUTHGEAR_WEB_SDK_SESSION_TYPE environment variable and always use access token instead?
I think practically we do not need cookies auth in site admin. This prevent anyone to set it up wrongly.

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.

@tung2744 tung2744 merged commit 98d5a0b into authgear:main Apr 30, 2026
11 checks passed
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