Merge pull request #2973 from influxdata/features/insecure-skip-verfiy-kapacitor

Unsafe SSL kapacitor insecure skip verify
pull/10616/head
Andrew Watkins 2018-03-15 09:21:17 -07:00 committed by GitHub
commit a8d55591b2
19 changed files with 328 additions and 156 deletions

1
.gitignore vendored
View File

@ -22,3 +22,4 @@ chronograf*.db
*_gen.go
canned/apps_gen.go
npm-debug.log
yarn-error.log

View File

@ -2,9 +2,12 @@
### Features
1. [#2973](https://github.com/influxdata/chronograf/pull/2973): Add unsafe SSL to Kapacitor UI configuration
### UI Improvements
### Bug Fixes
1. [#2911](https://github.com/influxdata/chronograf/pull/2911): Fix Heroku OAuth
1. [#2953](https://github.com/influxdata/chronograf/pull/2953): Fix error reporting in DataExplorer
1. [#2947](https://github.com/influxdata/chronograf/pull/2947): Fix Okta oauth2 provider support
@ -18,11 +21,11 @@
1. [#2910](https://github.com/influxdata/chronograf/pull/2910): Redesign system notifications
### Bug Fixes
1. [#2866](https://github.com/influxdata/chronograf/pull/2866): Change hover text on delete mappings confirmation button to 'Delete'
1. [#2911](https://github.com/influxdata/chronograf/pull/2911): Fix Heroku OAuth
1. [#2859](https://github.com/influxdata/chronograf/pull/2859): Enable Mappings save button when valid
1. [#2933](https://github.com/influxdata/chronograf/pull/2933): Include url in Kapacitor connection creation requests
1. [#2866](https://github.com/influxdata/chronograf/pull/2866): Change hover text on delete mappings confirmation button to 'Delete'
1. [#2911](https://github.com/influxdata/chronograf/pull/2911): Fix Heroku OAuth
1. [#2859](https://github.com/influxdata/chronograf/pull/2859): Enable Mappings save button when valid
1. [#2933](https://github.com/influxdata/chronograf/pull/2933): Include url in Kapacitor connection creation requests
## v1.4.2.1 [2018-02-28]

View File

@ -75,14 +75,15 @@ func UnmarshalSource(data []byte, s *chronograf.Source) error {
// MarshalServer encodes a server to binary protobuf format.
func MarshalServer(s chronograf.Server) ([]byte, error) {
return proto.Marshal(&Server{
ID: int64(s.ID),
SrcID: int64(s.SrcID),
Name: s.Name,
Username: s.Username,
Password: s.Password,
URL: s.URL,
Active: s.Active,
Organization: s.Organization,
ID: int64(s.ID),
SrcID: int64(s.SrcID),
Name: s.Name,
Username: s.Username,
Password: s.Password,
URL: s.URL,
Active: s.Active,
Organization: s.Organization,
InsecureSkipVerify: s.InsecureSkipVerify,
})
}
@ -101,6 +102,7 @@ func UnmarshalServer(data []byte, s *chronograf.Server) error {
s.URL = pb.URL
s.Active = pb.Active
s.Organization = pb.Organization
s.InsecureSkipVerify = pb.InsecureSkipVerify
return nil
}

View File

@ -668,14 +668,15 @@ func (m *TemplateQuery) GetFieldKey() string {
}
type Server struct {
ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"`
Username string `protobuf:"bytes,3,opt,name=Username,proto3" json:"Username,omitempty"`
Password string `protobuf:"bytes,4,opt,name=Password,proto3" json:"Password,omitempty"`
URL string `protobuf:"bytes,5,opt,name=URL,proto3" json:"URL,omitempty"`
SrcID int64 `protobuf:"varint,6,opt,name=SrcID,proto3" json:"SrcID,omitempty"`
Active bool `protobuf:"varint,7,opt,name=Active,proto3" json:"Active,omitempty"`
Organization string `protobuf:"bytes,8,opt,name=Organization,proto3" json:"Organization,omitempty"`
ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"`
Username string `protobuf:"bytes,3,opt,name=Username,proto3" json:"Username,omitempty"`
Password string `protobuf:"bytes,4,opt,name=Password,proto3" json:"Password,omitempty"`
URL string `protobuf:"bytes,5,opt,name=URL,proto3" json:"URL,omitempty"`
SrcID int64 `protobuf:"varint,6,opt,name=SrcID,proto3" json:"SrcID,omitempty"`
Active bool `protobuf:"varint,7,opt,name=Active,proto3" json:"Active,omitempty"`
Organization string `protobuf:"bytes,8,opt,name=Organization,proto3" json:"Organization,omitempty"`
InsecureSkipVerify bool `protobuf:"varint,9,opt,name=InsecureSkipVerify,proto3" json:"InsecureSkipVerify,omitempty"`
}
func (m *Server) Reset() { *m = Server{} }
@ -739,6 +740,13 @@ func (m *Server) GetOrganization() string {
return ""
}
func (m *Server) GetInsecureSkipVerify() bool {
if m != nil {
return m.InsecureSkipVerify
}
return false
}
type Layout struct {
ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
Application string `protobuf:"bytes,2,opt,name=Application,proto3" json:"Application,omitempty"`
@ -1306,15 +1314,15 @@ func init() {
func init() { proto.RegisterFile("internal.proto", fileDescriptorInternal) }
var fileDescriptorInternal = []byte{
// 1553 bytes of a gzipped FileDescriptorProto
// 1558 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x5f, 0x6f, 0xdb, 0x46,
0x12, 0x07, 0x25, 0x51, 0x12, 0x47, 0x4e, 0xce, 0xe0, 0xf9, 0x12, 0x5e, 0x0e, 0x38, 0xe8, 0x88,
0x3b, 0x9c, 0xee, 0x4f, 0xdc, 0x42, 0x41, 0xd1, 0x22, 0x68, 0x03, 0xc8, 0x56, 0x9b, 0xba, 0x71,
0x62, 0x67, 0x65, 0xbb, 0x4f, 0x45, 0xb0, 0x92, 0x46, 0x12, 0x11, 0x8a, 0x64, 0x97, 0xa4, 0x6d,
0xf6, 0xc3, 0x14, 0x28, 0xd0, 0x7e, 0x81, 0xa2, 0x2f, 0x7d, 0xea, 0x6b, 0xd1, 0x0f, 0xd1, 0xc7,
0x7e, 0x85, 0xbe, 0x16, 0xb3, 0xbb, 0xa4, 0x56, 0x96, 0x12, 0xe4, 0xa1, 0xe8, 0xdb, 0xfe, 0x66,
0x3b, 0x9c, 0xee, 0x4f, 0x7c, 0x07, 0x05, 0x45, 0x8b, 0xa0, 0x0d, 0x20, 0x5b, 0x6d, 0xea, 0xc6,
0x89, 0x9d, 0x95, 0xed, 0x3e, 0x15, 0xc1, 0x4a, 0x1a, 0x49, 0x44, 0x28, 0x92, 0x5d, 0x92, 0xb6,
0xd9, 0x0f, 0x53, 0xa0, 0x40, 0xfb, 0x05, 0x8a, 0xbe, 0xf4, 0xa9, 0xef, 0xfd, 0x10, 0x7d, 0xec,
0x57, 0x68, 0x1f, 0x8b, 0xd9, 0x5d, 0x52, 0x2b, 0x4b, 0x09, 0x52, 0xa0, 0xe8, 0xdb, 0xfe, 0x66,
0x86, 0xb3, 0xf3, 0x7f, 0x96, 0x70, 0x3b, 0x88, 0x32, 0x14, 0x11, 0x0f, 0xf7, 0x13, 0x11, 0x67,
0xb1, 0xdb, 0x2e, 0xb1, 0xff, 0x4b, 0x0d, 0x9a, 0xa3, 0x38, 0x17, 0x13, 0x74, 0x6f, 0x43, 0xed,
0xb1, 0xdb, 0x2e, 0xb1, 0xff, 0x63, 0x0d, 0x9a, 0xa3, 0x38, 0x17, 0x13, 0x74, 0x6f, 0x43, 0xed,
0x68, 0xe8, 0x59, 0x5d, 0xab, 0x57, 0x67, 0xb5, 0xa3, 0xa1, 0xeb, 0x42, 0xe3, 0x19, 0x5f, 0xa2,
0x57, 0xeb, 0x5a, 0x3d, 0x87, 0xc9, 0x33, 0xd1, 0xce, 0x8a, 0x04, 0xbd, 0xba, 0xa2, 0xd1, 0xd9,
0xbd, 0x07, 0xed, 0xf3, 0x94, 0xb4, 0x2d, 0xd1, 0x6b, 0x48, 0x7a, 0x85, 0x89, 0x77, 0xca, 0xd3,
@ -1324,85 +1332,85 @@ var fileDescriptorInternal = []byte{
0xf7, 0x28, 0x4a, 0x71, 0x92, 0x0b, 0x1c, 0xbd, 0x0c, 0x92, 0x0b, 0x14, 0xc1, 0xac, 0xf0, 0x1c,
0xa9, 0x60, 0x0b, 0x87, 0x6e, 0x79, 0x8a, 0x19, 0xa7, 0xbb, 0x41, 0xaa, 0x2a, 0xa1, 0xeb, 0xc3,
0xce, 0x68, 0xc1, 0x05, 0x4e, 0x47, 0x38, 0x11, 0x98, 0x79, 0x1d, 0xc9, 0x5e, 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, 0x89, 0x8d, 0x89, 0x66, 0x6d, 0xff, 0xe9, 0xb8,
0x69, 0xb9, 0xff, 0x95, 0x05, 0xad, 0xa7, 0xfa, 0x95, 0x65, 0x7a, 0x61, 0xbd, 0xd2, 0x8b, 0xda,
0x9a, 0x17, 0x7d, 0xd8, 0x2b, 0x65, 0xd6, 0xee, 0x57, 0x51, 0xd8, 0xca, 0xd3, 0x11, 0x6d, 0x54,
0xc9, 0x7a, 0x93, 0xbf, 0x8c, 0xb3, 0x75, 0x99, 0x6d, 0x09, 0xdf, 0xc8, 0x4a, 0x17, 0x3a, 0xfa,
0xef, 0x50, 0xfe, 0x6b, 0xe9, 0xa1, 0x6a, 0x90, 0xfc, 0x3e, 0x34, 0x0f, 0xe3, 0x68, 0x16, 0xcc,
0xdd, 0x1e, 0x34, 0x06, 0x79, 0xb6, 0x90, 0x1a, 0x3b, 0xfd, 0x3d, 0xa3, 0xf1, 0xf3, 0x6c, 0xa1,
0x64, 0x98, 0x94, 0xf0, 0xdf, 0x05, 0x58, 0xd1, 0x68, 0x4b, 0xac, 0xb2, 0xf1, 0x0c, 0xaf, 0xa8,
0x64, 0x52, 0xa9, 0xa5, 0xcd, 0xb6, 0x70, 0xfc, 0xf7, 0xc0, 0x39, 0xc8, 0x83, 0x70, 0x7a, 0x14,
0xcd, 0x62, 0x1a, 0x1d, 0x17, 0x28, 0xd2, 0x55, 0xbe, 0x4a, 0x48, 0xe1, 0xa6, 0x29, 0x52, 0xf5,
0x90, 0x46, 0xe3, 0xa6, 0xfc, 0x3b, 0x7f, 0xf0, 0x4b, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe8, 0x64,
0x6b, 0x1b, 0xaf, 0x0f, 0x00, 0x00,
}

View File

@ -109,6 +109,7 @@ message Server {
int64 SrcID = 6; // SrcID is the ID of the data source
bool Active = 7; // is this the currently active server for the source
string Organization = 8; // Organization is the organization ID that resource belongs to
bool InsecureSkipVerify = 9; // InsecureSkipVerify accepts any certificate from the client
}
message Layout {

View File

@ -76,12 +76,13 @@ func TestMarshalSourceWithSecret(t *testing.T) {
func TestMarshalServer(t *testing.T) {
v := chronograf.Server{
ID: 12,
SrcID: 2,
Name: "Fountain of Truth",
Username: "docbrown",
Password: "1 point twenty-one g1g@w@tts",
URL: "http://oldmanpeabody.mall.io:9092",
ID: 12,
SrcID: 2,
Name: "Fountain of Truth",
Username: "docbrown",
Password: "1 point twenty-one g1g@w@tts",
URL: "http://oldmanpeabody.mall.io:9092",
InsecureSkipVerify: true,
}
var vv chronograf.Server

View File

@ -20,22 +20,24 @@ func TestServerStore(t *testing.T) {
srcs := []chronograf.Server{
chronograf.Server{
Name: "Of Truth",
SrcID: 10,
Username: "marty",
Password: "I❤ jennifer parker",
URL: "toyota-hilux.lyon-estates.local",
Active: false,
Organization: "133",
Name: "Of Truth",
SrcID: 10,
Username: "marty",
Password: "I❤ jennifer parker",
URL: "toyota-hilux.lyon-estates.local",
Active: false,
Organization: "133",
InsecureSkipVerify: true,
},
chronograf.Server{
Name: "HipToBeSquare",
SrcID: 12,
Username: "calvinklein",
Password: "chuck b3rry",
URL: "toyota-hilux.lyon-estates.local",
Active: false,
Organization: "133",
Name: "HipToBeSquare",
SrcID: 12,
Username: "calvinklein",
Password: "chuck b3rry",
URL: "toyota-hilux.lyon-estates.local",
Active: false,
Organization: "133",
InsecureSkipVerify: false,
},
}

View File

@ -164,7 +164,8 @@ func TestServer(t *testing.T) {
"id": "5000",
"name": "Kapa 1",
"url": "http://localhost:9092",
"active": true,
"active": true,
"insecureSkipVerify": false,
"links": {
"proxy": "/chronograf/v1/sources/5000/kapacitors/5000/proxy",
"self": "/chronograf/v1/sources/5000/kapacitors/5000",
@ -222,7 +223,8 @@ func TestServer(t *testing.T) {
"id": "5000",
"name": "Kapa 1",
"url": "http://localhost:9092",
"active": true,
"active": true,
"insecureSkipVerify": false,
"links": {
"proxy": "/chronograf/v1/sources/5000/kapacitors/5000/proxy",
"self": "/chronograf/v1/sources/5000/kapacitors/5000",

View File

@ -16,7 +16,7 @@ type postKapacitorRequest struct {
URL *string `json:"url"` // URL for the kapacitor backend (e.g. http://localhost:9092);/ Required: true
Username string `json:"username,omitempty"` // Username for authentication to kapacitor
Password string `json:"password,omitempty"`
InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"` // InsecureSkipVerify as true means any certificate presented by the kapacitor is accepted.
InsecureSkipVerify bool `json:"insecureSkipVerify"` // InsecureSkipVerify as true means any certificate presented by the kapacitor is accepted.
Active bool `json:"active"`
Organization string `json:"organization"` // Organization is the organization ID that resource belongs to
}
@ -55,7 +55,7 @@ type kapacitor struct {
URL string `json:"url"` // URL for the kapacitor backend (e.g. http://localhost:9092)
Username string `json:"username,omitempty"` // Username for authentication to kapacitor
Password string `json:"password,omitempty"`
InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"` // InsecureSkipVerify as true means any certificate presented by the kapacitor is accepted.
InsecureSkipVerify bool `json:"insecureSkipVerify"` // InsecureSkipVerify as true means any certificate presented by the kapacitor is accepted.
Active bool `json:"active"`
Links kapaLinks `json:"links"` // Links are URI locations related to kapacitor
}
@ -225,7 +225,7 @@ type patchKapacitorRequest struct {
URL *string `json:"url,omitempty"` // URL for the kapacitor
Username *string `json:"username,omitempty"` // Username for kapacitor auth
Password *string `json:"password,omitempty"`
InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"` // InsecureSkipVerify as true means any certificate presented by the kapacitor is accepted.
InsecureSkipVerify *bool `json:"insecureSkipVerify"` // InsecureSkipVerify as true means any certificate presented by the kapacitor is accepted.
Active *bool `json:"active"`
}

View File

@ -1,7 +1,51 @@
export const source = {
id: '2',
name: 'minikube-influx',
type: 'influx',
url: 'http://192.168.99.100:30400',
default: true,
telegraf: 'telegraf',
organization: 'default',
role: 'viewer',
links: {
self: '/chronograf/v1/sources/2',
kapacitors: '/chronograf/v1/sources/2/kapacitors',
proxy: '/chronograf/v1/sources/2/proxy',
queries: '/chronograf/v1/sources/2/queries',
write: '/chronograf/v1/sources/2/write',
permissions: '/chronograf/v1/sources/2/permissions',
users: '/chronograf/v1/sources/2/users',
databases: '/chronograf/v1/sources/2/dbs',
annotations: '/chronograf/v1/sources/2/annotations',
},
}
export const kapacitor = {
id: '1',
name: 'Test Kapacitor',
url: 'http://localhost:9092',
insecureSkipVerify: false,
active: true,
links: {
self: '/chronograf/v1/sources/47/kapacitors/1',
proxy: '/chronograf/v1/sources/47/kapacitors/1/proxy',
},
}
export const createKapacitorBody = {
name: 'Test Kapacitor',
url: 'http://localhost:9092',
insecureSkipVerify: false,
username: 'user',
password: 'pass',
}
export const updateKapacitorBody = {
name: 'Test Kapacitor',
url: 'http://localhost:9092',
insecureSkipVerify: false,
username: 'user',
password: 'pass',
active: true,
links: {
self: '/chronograf/v1/sources/47/kapacitors/1',

1
ui/mocks/utils/ajax.ts Normal file
View File

@ -0,0 +1 @@
export default jest.fn(() => Promise.resolve())

View File

@ -4,6 +4,7 @@ import AlertOutputs from 'src/kapacitor/components/AlertOutputs'
import FancyScrollbar from 'src/shared/components/FancyScrollbar'
import Input from 'src/kapacitor/components/KapacitorFormInput'
import {insecureSkipVerifyText} from 'src/shared/copy/tooltipText'
import {Kapacitor, Source} from 'src/types'
export interface Notification {
@ -22,6 +23,7 @@ interface Props {
onReset: (e: MouseEvent<HTMLButtonElement>) => void
onSubmit: (e: ChangeEvent<HTMLFormElement>) => void
onInputChange: (e: ChangeEvent<HTMLInputElement>) => void
onCheckboxChange: (e: ChangeEvent<HTMLInputElement>) => void
onChangeUrl: (e: ChangeEvent<HTMLInputElement>) => void
source: Source
hash: string
@ -32,10 +34,11 @@ const KapacitorForm: SFC<Props> = ({
onChangeUrl,
onReset,
kapacitor,
kapacitor: {url, name, username, password},
kapacitor: {url, name, username, password, insecureSkipVerify},
onSubmit,
exists,
onInputChange,
onCheckboxChange,
source,
hash,
notify,
@ -92,6 +95,22 @@ const KapacitorForm: SFC<Props> = ({
inputType="password"
/>
</div>
{url.startsWith('https') &&
<div className="form-group col-xs-12">
<div className="form-control-static">
<input
type="checkbox"
id="insecureSkipVerifyCheckbox"
name="insecureSkipVerify"
checked={insecureSkipVerify}
onChange={onCheckboxChange}
/>
<label htmlFor="insecureSkipVerifyCheckbox">Unsafe SSL</label>
</div>
<label className="form-helper">
{insecureSkipVerifyText}
</label>
</div>}
<div className="form-group form-group-submit col-xs-12 text-center">
<button
className="btn btn-default"

View File

@ -44,6 +44,7 @@ interface Kapacitor {
username: string
password: string
active: boolean
insecureSkipVerify: boolean
links: {
self: string
}
@ -67,17 +68,8 @@ export class KapacitorPage extends PureComponent<Props, State> {
constructor(props) {
super(props)
this.state = {
kapacitor: {
url: this.parseKapacitorURL(),
name: defaultName,
username: '',
password: '',
active: false,
links: {
self: '',
},
},
exists: false,
kapacitor: this.defaultKapacitor,
exists: false
}
this.handleSubmit = this.handleSubmit.bind(this)
@ -99,6 +91,17 @@ export class KapacitorPage extends PureComponent<Props, State> {
}
}
handleCheckboxChange = (e: ChangeEvent<HTMLInputElement>) => {
const {checked} = e.target
this.setState({
kapacitor: {
...this.state.kapacitor,
insecureSkipVerify: checked
}
})
}
handleInputChange = (e: ChangeEvent<HTMLInputElement>) => {
const {value, name} = e.target
@ -159,18 +162,21 @@ export class KapacitorPage extends PureComponent<Props, State> {
handleResetToDefaults = e => {
e.preventDefault()
const defaultState = {
this.setState({kapacitor: {...this.defaultKapacitor}})
}
private get defaultKapacitor() {
return {
url: this.parseKapacitorURL(),
name: defaultName,
username: '',
password: '',
active: false,
insecureSkipVerify: false,
links: {
self: '',
},
}
this.setState({kapacitor: {...defaultState}})
}
private checkKapacitorConnection = async (kapacitor: Kapacitor) => {
@ -207,6 +213,7 @@ export class KapacitorPage extends PureComponent<Props, State> {
onReset={this.handleResetToDefaults}
onInputChange={this.handleInputChange}
notify={notify}
onCheckboxChange={this.handleCheckboxChange}
/>
)
}

View File

@ -104,7 +104,7 @@ export const deleteKapacitor = async kapacitor => {
export function createKapacitor(
source,
{url, name = 'My Kapacitor', username, password}
{url, name = 'My Kapacitor', username, password, insecureSkipVerify}
) {
return AJAX({
url: source.links.kapacitors,
@ -114,6 +114,7 @@ export function createKapacitor(
url,
username,
password,
insecureSkipVerify,
},
})
}
@ -125,6 +126,7 @@ export function updateKapacitor({
username,
password,
active,
insecureSkipVerify,
}) {
return AJAX({
url: links.self,
@ -135,6 +137,7 @@ export function updateKapacitor({
username,
password,
active,
insecureSkipVerify,
},
})
}

View File

@ -31,6 +31,7 @@ export interface Kapacitor {
name: string
username?: string
password?: string
insecureSkipVerify: boolean
active: boolean
links: {
self: string

View File

@ -57,19 +57,53 @@ describe('Kapacitor.Containers.KapacitorPage', () => {
describe('user interactions ', () => {
describe('entering the url', () => {
it('renders the text that is inputted', () => {
const {wrapper} = setup()
const value = '/new/url'
const event = {target: {value}}
describe('with a http url', () => {
it('renders the text that is inputted', () => {
const {wrapper} = setup()
const value = 'http://example.com'
const event = {target: {value}}
let inputElement = wrapper.find('#kapaUrl')
let inputElement = wrapper.find('#kapaUrl')
inputElement.simulate('change', event)
wrapper.update()
inputElement.simulate('change', event)
inputElement = wrapper.find('#kapaUrl')
inputElement = wrapper.find('#kapaUrl')
const secureCheckbox = wrapper.find('#insecureSkipVerifyCheckbox')
expect(inputElement.prop('value')).toBe(value)
expect(secureCheckbox.exists()).toBe(false)
expect(inputElement.prop('value')).toBe(value)
})
})
describe('with a https url', () => {
let inputElement, secureCheckbox, wrapper
const value = 'https://example.com'
beforeEach(() => {
wrapper = setup().wrapper
const event = {target: {value}}
inputElement = wrapper.find('#kapaUrl')
inputElement.simulate('change', event)
inputElement = wrapper.find('#kapaUrl')
secureCheckbox = wrapper.find('#insecureSkipVerifyCheckbox')
})
describe('checking the insecure skip verify checkbox', () => {
it("changes the state", () => {
const checked = true
const event = {target: {checked}}
secureCheckbox.simulate('change', event)
secureCheckbox = wrapper.find('#insecureSkipVerifyCheckbox')
expect(secureCheckbox.prop('checked')).toBe(true)
})
})
it('renders the https secure checkbox', () => {
expect(secureCheckbox.exists()).toBe(true)
expect(inputElement.prop('value')).toBe(value)
})
})
})

View File

@ -54,6 +54,7 @@ export const kapacitor = {
username: 'influx',
password: '',
active: false,
insecureSkipVerify: false,
links: {
self: '/kapa/1',
proxy: '/proxy/kapacitor/1',

View File

@ -0,0 +1,42 @@
import {createKapacitor, updateKapacitor} from 'src/shared/apis'
import {
source,
kapacitor,
updateKapacitorBody,
createKapacitorBody,
} from 'mocks/dummy'
import AJAX from 'src/utils/ajax'
jest.mock('src/utils/ajax', () => require('mocks/utils/ajax'))
describe('Shared.Apis', () => {
afterEach(() => {
jest.clearAllMocks()
})
describe('createKapacitor', () => {
it('is called with the expected body', () => {
createKapacitor(source, createKapacitorBody)
expect(AJAX).toHaveBeenCalledWith({
url: source.links.kapacitors,
method: 'POST',
data: createKapacitorBody,
})
})
})
describe('updateKapacitor', () => {
it('is called with the expected body', () => {
updateKapacitor(updateKapacitorBody)
let data = {...updateKapacitorBody}
delete data.links
expect(AJAX).toHaveBeenCalledWith({
url: kapacitor.links.self,
method: 'PATCH',
data,
})
})
})
})