mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
186fda1657
###What Adds an optional sensitive parameter for customHeaders to all current addons. It is sensitive because the user might be including api key headers.
102 lines
3.0 KiB
TypeScript
102 lines
3.0 KiB
TypeScript
import {
|
|
FEATURE_CREATED,
|
|
FEATURE_UPDATED,
|
|
FEATURE_ARCHIVED,
|
|
FEATURE_REVIVED,
|
|
FEATURE_STALE_ON,
|
|
FEATURE_STALE_OFF,
|
|
FEATURE_ENVIRONMENT_ENABLED,
|
|
FEATURE_ENVIRONMENT_DISABLED,
|
|
FEATURE_STRATEGY_REMOVE,
|
|
FEATURE_STRATEGY_UPDATE,
|
|
FEATURE_STRATEGY_ADD,
|
|
FEATURE_METADATA_UPDATED,
|
|
FEATURE_PROJECT_CHANGE,
|
|
FEATURE_VARIANTS_UPDATED,
|
|
} from '../types/events';
|
|
import { IAddonDefinition } from '../types/model';
|
|
|
|
const slackDefinition: IAddonDefinition = {
|
|
name: 'slack',
|
|
displayName: 'Slack',
|
|
description: 'Allows Unleash to post updates to Slack.',
|
|
documentationUrl: 'https://docs.getunleash.io/docs/addons/slack',
|
|
parameters: [
|
|
{
|
|
name: 'url',
|
|
displayName: 'Slack webhook URL',
|
|
description: '(Required)',
|
|
type: 'url',
|
|
required: true,
|
|
sensitive: true,
|
|
},
|
|
{
|
|
name: 'username',
|
|
displayName: 'Username',
|
|
placeholder: 'Unleash',
|
|
description:
|
|
'The username to use when posting messages to slack. Defaults to "Unleash".',
|
|
type: 'text',
|
|
required: false,
|
|
sensitive: false,
|
|
},
|
|
{
|
|
name: 'emojiIcon',
|
|
displayName: 'Emoji Icon',
|
|
placeholder: ':unleash:',
|
|
description:
|
|
'The emoji_icon to use when posting messages to slack. Defaults to ":unleash:".',
|
|
type: 'text',
|
|
required: false,
|
|
sensitive: false,
|
|
},
|
|
{
|
|
name: 'defaultChannel',
|
|
displayName: 'Default channel',
|
|
description:
|
|
'(Required) Default channel to post updates to if not specified in the slack-tag',
|
|
type: 'text',
|
|
required: true,
|
|
sensitive: false,
|
|
},
|
|
{
|
|
name: 'customHeaders',
|
|
displayName: 'Extra HTTP Headers',
|
|
placeholder: `{
|
|
"ISTIO_USER_KEY": "hunter2",
|
|
"SOME_OTHER_CUSTOM_HTTP_HEADER": "SOMEVALUE"
|
|
}`,
|
|
description: `(Optional) Used to add extra HTTP Headers to the request the plugin fires off. Format here needs to be a valid json object of key value pairs where both key and value are strings`,
|
|
required: false,
|
|
sensitive: true,
|
|
type: 'textfield',
|
|
},
|
|
],
|
|
events: [
|
|
FEATURE_CREATED,
|
|
FEATURE_UPDATED,
|
|
FEATURE_ARCHIVED,
|
|
FEATURE_REVIVED,
|
|
FEATURE_STALE_ON,
|
|
FEATURE_STALE_OFF,
|
|
FEATURE_ENVIRONMENT_ENABLED,
|
|
FEATURE_ENVIRONMENT_DISABLED,
|
|
FEATURE_STRATEGY_REMOVE,
|
|
FEATURE_STRATEGY_UPDATE,
|
|
FEATURE_STRATEGY_ADD,
|
|
FEATURE_METADATA_UPDATED,
|
|
FEATURE_VARIANTS_UPDATED,
|
|
FEATURE_PROJECT_CHANGE,
|
|
],
|
|
tagTypes: [
|
|
{
|
|
name: 'slack',
|
|
description:
|
|
'Slack tag used by the slack-addon to specify the slack channel.',
|
|
icon: 'S',
|
|
},
|
|
],
|
|
};
|
|
|
|
export default slackDefinition;
|