-
Notifications
You must be signed in to change notification settings - Fork 23
adding "session.revoke" to events type #500
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
Conversation
Greptile OverviewGreptile SummaryAdds support for Changes:
Minor issues:
Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant App as Application
participant SDK as WorkOS Python SDK
participant API as WorkOS API
participant Webhook as Webhook Handler
Note over App,Webhook: Session Revoked Event Flow
rect rgb(240, 240, 255)
Note right of API: Event occurs in WorkOS
API->>API: Session revoked
API->>Webhook: POST session.revoked event
Webhook->>SDK: Parse webhook payload
SDK->>SDK: Deserialize to SessionRevokedWebhook
SDK->>SDK: Extract SessionRevokedPayload
Webhook-->>App: SessionRevokedEvent object
end
rect rgb(255, 240, 240)
Note right of App: Polling for events
App->>SDK: client.events.list_events(events=["session.revoked"])
SDK->>API: GET /events?events=session.revoked
API-->>SDK: Event data
SDK->>SDK: Deserialize to SessionRevokedEvent
SDK-->>App: List[SessionRevokedEvent]
end
Note over App,Webhook: SessionRevokedPayload contains:<br/>id, user_id, ip_address, user_agent,<br/>organization_id, impersonator, timestamps
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5 files reviewed, 4 comments
| user_agent: Optional[str] = None | ||
| user_id: str | ||
| created_at: str | ||
| updated_at: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: missing newline at end of file
| updated_at: str | |
| updated_at: str | |
Prompt To Fix With AI
This is a comment left during a code review.
Path: workos/types/events/session_payload.py
Line: 27:27
Comment:
**style:** missing newline at end of file
```suggestion
updated_at: str
```
How can I resolve this? If you propose a fix, please make it concise.
workos/types/events/event.py
Outdated
| from workos.types.events.session_payload import( | ||
| SessionCreatedPayload, | ||
| SessionRevokedPayload | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: missing space before ( in import statement - should be import ( not import(
| from workos.types.events.session_payload import( | |
| SessionCreatedPayload, | |
| SessionRevokedPayload | |
| ) | |
| from workos.types.events.session_payload import ( | |
| SessionCreatedPayload, | |
| SessionRevokedPayload | |
| ) |
Prompt To Fix With AI
This is a comment left during a code review.
Path: workos/types/events/event.py
Line: 39:42
Comment:
**style:** missing space before `(` in import statement - should be `import (` not `import(`
```suggestion
from workos.types.events.session_payload import (
SessionCreatedPayload,
SessionRevokedPayload
)
```
How can I resolve this? If you propose a fix, please make it concise.
workos/types/events/event_model.py
Outdated
| from workos.types.events.session_payload import( | ||
| SessionCreatedPayload, | ||
| SessionRevokedPayload | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: missing space before ( in import statement - should be import ( not import(
| from workos.types.events.session_payload import( | |
| SessionCreatedPayload, | |
| SessionRevokedPayload | |
| ) | |
| from workos.types.events.session_payload import ( | |
| SessionCreatedPayload, | |
| SessionRevokedPayload | |
| ) |
Prompt To Fix With AI
This is a comment left during a code review.
Path: workos/types/events/event_model.py
Line: 39:42
Comment:
**style:** missing space before `(` in import statement - should be `import (` not `import(`
```suggestion
from workos.types.events.session_payload import (
SessionCreatedPayload,
SessionRevokedPayload
)
```
How can I resolve this? If you propose a fix, please make it concise.
workos/types/webhooks/webhook.py
Outdated
| from workos.types.events.session_payload import( | ||
| SessionCreatedPayload, | ||
| SessionRevokedPayload | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: missing space before ( in import statement - should be import ( not import(
| from workos.types.events.session_payload import( | |
| SessionCreatedPayload, | |
| SessionRevokedPayload | |
| ) | |
| from workos.types.events.session_payload import ( | |
| SessionCreatedPayload, | |
| SessionRevokedPayload | |
| ) |
Prompt To Fix With AI
This is a comment left during a code review.
Path: workos/types/webhooks/webhook.py
Line: 39:42
Comment:
**style:** missing space before `(` in import statement - should be `import (` not `import(`
```suggestion
from workos.types.events.session_payload import (
SessionCreatedPayload,
SessionRevokedPayload
)
```
How can I resolve this? If you propose a fix, please make it concise.
mattgd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor formatting fixes needed, but this looks good otherwise. Thanks!
Description
Session.revoke event was missing, this PR adds support for it in the Python SDK
Local Test using Ipython:
Documentation
Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.
If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.