You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix SSO wire format: id key, ms timestamp, camelCase payload
The hand-written sso module produced tokens the FastComments server rejects
(verified against server util/sso-utils.ts decryptSSOPayload):
- SecureSSOUserData serialized `user_id` instead of `id`, so tokens failed
with missing-user-id
- FastCommentsSSO.new_secure used epoch seconds instead of milliseconds
- SecureSSOPayload emitted snake_case keys (user_data_json_base64) instead of
the widget/server format userDataJSONBase64 / verificationHash
- SimpleSSOUserData omitted username entirely
Also:
- Add the optional Secure SSO fields (avatar, displayName, websiteUrl,
groupIds, isAdmin, isModerator, ...), null-stripping, and login/logout URLs;
add SecureSSOPayload.to_widget_dict() for embedding in a widget config
- Move the generated client's runtime deps (pydantic, urllib3, ...) into a
`client` extra so the base install is pure-stdlib SSO
- Fix README examples (id kwarg, api_key auth key, host without /api)
- Rewrite the unit tests to assert the real wire format and add a pinned
cross-SDK parity vector; make unit tests run offline and gate the
integration tests on real credentials
1.**401 "missing-api-key" error**: Make sure you set `config.api_key = {"ApiKeyAuth": "YOUR_KEY"}` before creating the DefaultApi instance.
156
+
1.**401 "missing-api-key" error**: Make sure you set `config.api_key = {"api_key": "YOUR_KEY"}` before creating the DefaultApi instance.
160
157
2.**Wrong API class**: Use `DefaultApi` for server-side authenticated requests, `PublicApi` for client-side/public requests, and `ModerationApi` for moderator dashboard requests.
161
158
3.**Import errors**: Make sure you're importing from the correct module:
162
159
- API client: `from client import ...`
@@ -198,10 +195,15 @@ You'll see you're supposed to pass a `broadcast_id` in some API calls. When you
198
195
## Requirements
199
196
200
197
- Python >= 3.8
201
-
- urllib3 >= 1.25.3
202
-
- python-dateutil >= 2.8.2
203
-
- pydantic >= 2.0.0
204
-
- typing-extensions >= 4.0.0
198
+
199
+
The base install is pure-stdlib and provides the SSO utilities. The generated
200
+
API client (`DefaultApi`/`PublicApi`/`ModerationApi`) needs the `client` extra,
201
+
which pulls in `urllib3 >= 1.25.3`, `python-dateutil >= 2.8.2`,
202
+
`pydantic >= 2.0.0`, and `typing-extensions >= 4.0.0`:
0 commit comments