Skip to content
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

fix: ioc-4292. correct issues with entp bindings in console api spec #33

Merged
merged 2 commits into from
Jun 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions e2e/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,20 +456,19 @@ describe('Workspace credential test', () => {
expect(res.body.client_secrets).toBeDefined()
})

// commented out because endpoint returns 404 - tracked internally at IOC-4292
// test('test uploadAndBindCertificate API', async () => {
// expect(credentialId).toBeDefined() // if not, createEnterpriseIntegration test failed
test('test uploadAndBindCertificate API', async () => {
expect(credentialId).toBeDefined() // if not, createEnterpriseIntegration test failed

// expect(orgId).toBeDefined()
expect(orgId).toBeDefined()

// const keyPair = cert.generate('aio-lib-console-e2e-additional-certificate', 365, { country: 'US', state: 'CA', locality: 'SF', organization: 'Adobe', unit: 'AdobeIO' })
// const certFile = tmp.fileSync({ postfix: '.crt' })
// fs.writeFileSync(certFile.fd, keyPair.cert)
// const res = await sdkClient.uploadAndBindCertificate(orgId, credentialId, fs.createReadStream(certFile.name))
// expect(res.ok).toBe(true)
// expect(res.status).toBe(200)
// expect(typeof (res.body)).toBe('object')
// })
const keyPair = cert.generate('aio-lib-console-e2e-additional-certificate', 365, { country: 'US', state: 'CA', locality: 'SF', organization: 'Adobe', unit: 'AdobeIO' })
const certFile = tmp.fileSync({ postfix: '.crt' })
fs.writeFileSync(certFile.fd, keyPair.cert)
const res = await sdkClient.uploadAndBindCertificate(orgId, credentialId, fs.createReadStream(certFile.name))
expect(res.ok).toBe(true)
expect(res.status).toBe(200)
expect(typeof (res.body)).toBe('object')
})

// delete
test('test deleteCredential API (integrationType: entp)', async () => {
Expand Down
19 changes: 14 additions & 5 deletions spec/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -3797,7 +3797,7 @@
]
}
},
"/console/organizations/{orgId}/integrations/{intId}/bindings": {
"/console/organizations/{orgId}/integrations/entp/{intId}/bindings": {
"post": {
"summary": "upload and bind certificate",
"tags": [
Expand Down Expand Up @@ -3844,13 +3844,22 @@
"requestBody": {
"required": true,
"content": {
"application/json": {
"multipart/form-data": {
"schema": {
"type": "file"
"type": "object",
"required": [
"certificate"
],
"properties": {
"certificate": {
"type": "string",
"format": "binary"
}
}
}
}
},
"description": "certificate"
"description": "form data"
},
"responses": {
"200": {
Expand Down Expand Up @@ -4048,7 +4057,7 @@
]
}
},
"/console/organizations/{orgId}/integrations/{intId}/bindings/{bindingId}": {
"/console/organizations/{orgId}/integrations/entp/{intId}/bindings/{bindingId}": {
"delete": {
"summary": "delete binding",
"tags": [
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ class CoreConsoleAPI {

try {
const res = await this.sdk.apis.Organizations
.get_console_organizations__orgId__integrations__intId__bindings(
.get_console_organizations__orgId__integrations_entp__intId__bindings(
...this.__createRequestOptions(parameters)
)
return res
Expand All @@ -975,7 +975,7 @@ class CoreConsoleAPI {

try {
const res = await this.sdk.apis.Organizations
.post_console_organizations__orgId__integrations__intId__bindings(
.post_console_organizations__orgId__integrations_entp__intId__bindings(
...this.__createRequestOptions(parameters, requestBody)
)
return res
Expand All @@ -998,7 +998,7 @@ class CoreConsoleAPI {

try {
const res = await this.sdk.apis.Organizations
.delete_console_organizations__orgId__integrations__intId__bindings__bindingId_(
.delete_console_organizations__orgId__integrations_entp__intId__bindings__bindingId_(
...this.__createRequestOptions(parameters)
)
return res
Expand Down
6 changes: 3 additions & 3 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ test('getBindingsForIntegration', async () => {
const apiOptions = createSwaggerOptions()

await standardTest({
fullyQualifiedApiName: 'Organizations.get_console_organizations__orgId__integrations__intId__bindings',
fullyQualifiedApiName: 'Organizations.get_console_organizations__orgId__integrations_entp__intId__bindings',
sdkFunctionName: 'getBindingsForIntegration',
apiParameters,
apiOptions,
Expand All @@ -713,7 +713,7 @@ test('uploadAndBindCertificate', async () => {
const apiOptions = createSwaggerOptions({ certificate: 'certificate' })

await standardTest({
fullyQualifiedApiName: 'Organizations.post_console_organizations__orgId__integrations__intId__bindings',
fullyQualifiedApiName: 'Organizations.post_console_organizations__orgId__integrations_entp__intId__bindings',
sdkFunctionName: 'uploadAndBindCertificate',
apiParameters,
apiOptions,
Expand All @@ -733,7 +733,7 @@ test('deleteBinding', async () => {
const apiOptions = createSwaggerOptions()

await standardTest({
fullyQualifiedApiName: 'Organizations.delete_console_organizations__orgId__integrations__intId__bindings__bindingId_',
fullyQualifiedApiName: 'Organizations.delete_console_organizations__orgId__integrations_entp__intId__bindings__bindingId_',
sdkFunctionName: 'deleteBinding',
apiParameters,
apiOptions,
Expand Down