move provisioning routes into /provision/
This commit is contained in:
@@ -35,7 +35,7 @@ describe('Provision', function () {
|
||||
|
||||
describe('DNS Setup', async function () {
|
||||
it('fails without provider', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/setup`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/setup`)
|
||||
.send({ domainConfig: { domain: DOMAIN, config: {} } })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -43,7 +43,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('fails with invalid provider', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/setup`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/setup`)
|
||||
.send({ domainConfig: { provider: 'foobar', domain: DOMAIN, config: {} } })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -51,7 +51,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('fails with missing domain', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/setup`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/setup`)
|
||||
.send({ domainConfig: { provider: 'noop', config: {} } })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -59,7 +59,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('fails with invalid domain', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/setup`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/setup`)
|
||||
.send({ domainConfig: { provider: 'noop', domain: '.foo', config: {} } })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -67,7 +67,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('fails with invalid config', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/setup`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/setup`)
|
||||
.send({ domainConfig: { provider: 'noop', domain: DOMAIN, config: 'not an object' } })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -75,7 +75,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('fails with invalid zoneName', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/setup`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/setup`)
|
||||
.send({ domainConfig: { provider: 'noop', domain: DOMAIN, config: {}, zoneName: 1337 } })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -83,7 +83,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('fails with invalid tlsConfig', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/setup`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/setup`)
|
||||
.send({ domainConfig: { provider: 'noop', domain: DOMAIN, config: {}, tlsConfig: 'foobar' } })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -91,7 +91,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('fails with invalid tlsConfig provider', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/setup`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/setup`)
|
||||
.send({ domainConfig: { provider: 'noop', domain: DOMAIN, config: {}, tlsConfig: { provider: 1337 } } })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -99,7 +99,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('succeeds', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/setup`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/setup`)
|
||||
.send({ domainConfig: { provider: 'noop', domain: DOMAIN, adminFqdn: 'my.' + DOMAIN, config: {}, tlsConfig: { provider: 'fallback' } } })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -109,7 +109,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('twice succeeds', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/setup`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/setup`)
|
||||
.send({ domainConfig: { provider: 'noop', domain: DOMAIN, adminFqdn: 'my.' + DOMAIN, config: {}, tlsConfig: { provider: 'fallback' } } })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -127,7 +127,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('fails without username', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/activate`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/activate`)
|
||||
.send({ password: owner.password, email: owner.email })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -135,7 +135,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('fails with invalid username', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/activate`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/activate`)
|
||||
.send({ username: '?this.is-not!valid', password: owner.password, email: owner.email })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -143,7 +143,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('fails due to empty username', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/activate`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/activate`)
|
||||
.send({ username: '', password: owner.password, email: owner.email })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -151,7 +151,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('fails without email', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/activate`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/activate`)
|
||||
.send({ username: owner.username, password: owner.password })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -159,7 +159,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('fails due to empty email', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/activate`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/activate`)
|
||||
.send({ username: owner.username, password: owner.password, email: '' })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -167,7 +167,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('fails due to invalid email', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/activate`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/activate`)
|
||||
.send({ username: owner.username, password: owner.password, email: 'invalidemail' })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -175,7 +175,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('fails without password', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/activate`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/activate`)
|
||||
.send({ username: owner.password.username, email: owner.email })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -183,7 +183,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('fails due to empty password', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/activate`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/activate`)
|
||||
.send({ username: owner.username, password: '', email: owner.email })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -191,7 +191,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('fails with invalid password', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/activate`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/activate`)
|
||||
.send({ username: owner.username, password: 'short', email: owner.email })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -199,7 +199,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('fails due to wrong displayName type', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/activate`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/activate`)
|
||||
.send({ username: owner.username, password: owner.password, email: owner.email, displayName: 1234 })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -207,7 +207,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('succeeds', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/activate`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/activate`)
|
||||
.send({ username: owner.username, password: owner.password, email: owner.email, displayName: owner.displayName });
|
||||
|
||||
expect(response.statusCode).to.equal(201);
|
||||
@@ -215,7 +215,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('fails the second time', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/activate`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/activate`)
|
||||
.send({ username: owner.username, password: owner.password, email: owner.email, displayName: owner.displayName })
|
||||
.ok(() => true);
|
||||
|
||||
@@ -223,7 +223,7 @@ describe('Provision', function () {
|
||||
});
|
||||
|
||||
it('after fails', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/cloudron/setup`)
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/provision/setup`)
|
||||
.send({ domainConfig: { provider: 'noop', domain: DOMAIN, adminFqdn: 'my.' + DOMAIN, config: {}, tlsConfig: { provider: 'fallback' } } })
|
||||
.ok(() => true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user