Skip to content

Conversation

@bin-ario
Copy link
Contributor

@bin-ario bin-ario commented Jan 28, 2026

makes it easy to find an AuthUser's chrome container/app, the names will be like chrome-123456-google
if auth is disabled, use a fake user with random user_id, the container name will be like chrome-xyz123-noauth

verified with tests/manual.py

@bin-ario bin-ario requested review from ariya and kpprasa and removed request for ariya January 28, 2026 21:47
def _get_user_for_no_auth() -> AuthUser:
"""Fake auth user for when auth is disabled to keep the code consistent."""
sub = generate(FRIENDLY_CHARS, 6)
return AuthUser(sub=sub, auth_provider=NO_AUTH_PROVIDER)
Copy link
Contributor

Choose a reason for hiding this comment

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

@faisalive @broerjuang Please confirm that this new format, e.g. xyz123-noauth will not break signin etc, for demo apps.

Copy link
Contributor Author

@bin-ario bin-ario Jan 28, 2026

Choose a reason for hiding this comment

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

similar to gateway, demo apps will set the token header to ario_APPKEY_xyz123
then the user_id will be like xyz123-ario

where ario is the first party auth provider name (used to getgather), APPKEY is pre-defined random key, xyz123 is generated by express session id

Copy link
Contributor

Choose a reason for hiding this comment

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

cool so it sounds like the user_id will always avoid the underscores which I think is needed

Only numbers, lowercase letters and dashes are allowed.
Maximum length is 54 characters.
"""
return f"{self.sub}-{self.auth_provider}"
Copy link
Contributor

Choose a reason for hiding this comment

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

why sub-auth provider rather than auth provider - sub? Just curious

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no strong preference, more like firstname - lastname

return v

@model_validator(mode="after")
def validate_user_id(self) -> "AuthUser":
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you want to reverse parse it to check if the auth_provider is valid?

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.

4 participants