Django-slackchat-serializer

Latest version: v1.1.2

Safety actively analyzes 613705 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

1.0.0

The main change is the creation of a CMS to manage and create Slack Chats. Adding this feature does come with a few more required options and some non-breaking additions to the webhook payloads which have also been added to the docs in this PR.

New Routes
- `root/cms/`: A list view of all the chats
- `root/cms/new`: A form to make a new chat. The owner will be set to the logged in user or the default owner.
- `root/cms/{id}/edit`: An form to edit the chat with the id of `id`.
- `root/api/cms/`: An API endpoint to `POST` a new a `Channel` or `PATCH` an existing one.


New Settings Options

| Name | Type | Description | Example | Required |
| --- | --- | --- | --- | --- |
| `SLACKCHAT_PUBLISH_ROOT`| String (URL) | The root of your front end. Will be combined with the `publish_path` of both the `ChatType` and `Channel` to create preview links in the CMS. | `“https://example.com/slack-chats/“` | Yes |
| `SLACKCHAT_TEAM_ROOT`| String (URL) | The root of your Slack team. Also used to create preview links in the CMS. | `“https://politico.slack.com”` | Yes |
| `SLACKCHAT_DEFAULT_OWNER`| String (Slack User ID) | The Slack User ID for a user that will be the default owner of Slack chats if the user logged in to the CMS does not have a matching Slack User model | `“UELJYGUAJ”` |Yes |
| `SLACKCHAT_MANAGERS`| String[] (Slack User ID) | An array of Slack User IDs. These users will be automatically invited to any new channels made by Slackchat serializer. | `[“UELJYGUAJ”]` | No |
| `SLACKCHAT_CMS_TOKEN`| String | A token used to authenticate API requests made by the CMS. Defaults to a random hash created on server startup. | `“12345”` |No |

Webhook Payloads
Changed Payloads
`republish_request`

The `channel_data` property has been added to this payload which contains the same data available from the channel’s API endpoint serialized into a JSON string. The full payload now takes the form of:

{
token: 'SLACK_WEBHOOK_VERIFICATION_TOKEN',
type: 'republish_request',
channel: '{{ channel_id }}',
channel_data: 'Serialized {{ channel} } data',
chat_type: '{{ channel.chat_type.name }}'
}



New Payloads
`unpublish_request`

A request to delete a given Slackchat. The payload takes the form of:

{
token: 'SLACK_WEBHOOK_VERIFICATION_TOKEN',
type: 'unpublish_request',
channel: '{{ channel_id }}',
channel_data: 'Serialized {{ channel} } data',
chat_type: '{{ channel.chat_type.name }}'
}

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.