Merge Boundary UI OSS branch 'main' at commit ee2fa6df7
This commit is contained in:
commit
1b2213ebc8
6 files changed
+69
-63
No files matched your search
@@ -41,7 +41,7 @@
|
||||
placeholder='/home/ubuntu/boundary'
|
||||
/>
|
||||
|
||||
{{#if (feature-flag 'byow-pki-upstream')}}
|
||||
{{#if (not (feature-flag 'byow-pki-hcp-cluster-id'))}}
|
||||
<form.input
|
||||
@name='initial_upstreams'
|
||||
@value={{this.initialUpstreams}}
|
||||
|
||||
@@ -90,9 +90,9 @@ worker {
|
||||
public_addr = "${this.ipAddress || '<public_ip_address>'}"
|
||||
auth_storage_path = "${this.configFilePath || '<path>'}/worker1"
|
||||
${
|
||||
this.features.isEnabled('byow-pki-upstream')
|
||||
? `${tagsText}${upstreamText}`
|
||||
: `${tagsText}`
|
||||
this.features.isEnabled('byow-pki-hcp-cluster-id')
|
||||
? `${tagsText}`
|
||||
: `${tagsText}${upstreamText}`
|
||||
}
|
||||
}`;
|
||||
|
||||
|
||||
@@ -5,47 +5,10 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const features = require('./features');
|
||||
|
||||
const APP_NAME = process.env.APP_NAME || 'Boundary';
|
||||
const API_HOST = process.env.API_HOST || '';
|
||||
const EDITION = process.env.EDITION || 'oss'; // Default edition is OSS
|
||||
|
||||
// Base edition declares available features, disabled by default.
|
||||
const baseEdition = {
|
||||
byow: false,
|
||||
'byow-pki-hcp-cluster-id': false,
|
||||
'byow-pki-upstream': false,
|
||||
'json-credentials': false,
|
||||
'ssh-target': false,
|
||||
'static-credentials': false,
|
||||
'target-worker-filters-v2': false,
|
||||
'target-worker-filters-v2-ingress': false,
|
||||
'target-worker-filters-v2-hcp': false,
|
||||
'target-network-address': false,
|
||||
'vault-worker-filter': false,
|
||||
};
|
||||
// Editions maps edition keys to their associated featuresets.
|
||||
const featureEditions = {};
|
||||
featureEditions.oss = {
|
||||
...baseEdition,
|
||||
byow: true,
|
||||
'byow-pki-upstream': true,
|
||||
'json-credentials': true,
|
||||
'static-credentials': true,
|
||||
'target-worker-filters-v2': true,
|
||||
'target-network-address': true,
|
||||
};
|
||||
featureEditions.enterprise = {
|
||||
...featureEditions.oss,
|
||||
'ssh-target': true,
|
||||
'target-worker-filters-v2-ingress': true,
|
||||
'vault-worker-filter': true,
|
||||
};
|
||||
featureEditions.hcp = {
|
||||
...featureEditions.enterprise,
|
||||
'byow-pki-hcp-cluster-id': true,
|
||||
'byow-pki-upstream': false,
|
||||
'target-worker-filters-v2-hcp': true,
|
||||
};
|
||||
|
||||
module.exports = function (environment) {
|
||||
let ENV = {
|
||||
@@ -135,22 +98,11 @@ module.exports = function (environment) {
|
||||
timeout: 4000,
|
||||
},
|
||||
|
||||
selectedEdition: EDITION,
|
||||
featureEditions,
|
||||
selectedEdition: features.selectedEdition,
|
||||
featureEditions: features.featureEditions,
|
||||
featureFlags: {},
|
||||
};
|
||||
|
||||
/**
|
||||
* Takes a set of features and enables them in all editions.
|
||||
* For use in development and testing only.
|
||||
*/
|
||||
const enableFeaturesInAllEditions = (features = {}) => {
|
||||
Object.entries(featureEditions).forEach(
|
||||
([key, edition]) =>
|
||||
(ENV.featureEditions[key] = { ...features, ...edition })
|
||||
);
|
||||
};
|
||||
|
||||
if (environment === 'development') {
|
||||
// ENV.APP.LOG_RESOLVER = true;
|
||||
// ENV.APP.LOG_ACTIVE_GENERATION = true;
|
||||
@@ -174,10 +126,13 @@ module.exports = function (environment) {
|
||||
|
||||
// Default edition in development
|
||||
ENV.selectedEdition = 'enterprise';
|
||||
enableFeaturesInAllEditions({
|
||||
// Show edition toggle in UI in development
|
||||
'dev-edition-toggle': true,
|
||||
});
|
||||
features.enableFeaturesInAllEditions(
|
||||
{
|
||||
// Show edition toggle in UI in development
|
||||
'dev-edition-toggle': true,
|
||||
},
|
||||
ENV
|
||||
);
|
||||
}
|
||||
|
||||
if (environment === 'test') {
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
const EDITION = process.env.EDITION || 'oss'; // Default edition is OSS
|
||||
|
||||
const selectedEdition = EDITION;
|
||||
|
||||
// Base edition declares available features, disabled by default.
|
||||
const baseEdition = {
|
||||
byow: false,
|
||||
'byow-pki-hcp-cluster-id': false,
|
||||
'json-credentials': false,
|
||||
'ssh-target': false,
|
||||
'static-credentials': false,
|
||||
'target-worker-filters-v2': false,
|
||||
'target-worker-filters-v2-ingress': false,
|
||||
'target-worker-filters-v2-hcp': false,
|
||||
'target-network-address': false,
|
||||
'vault-worker-filter': false,
|
||||
};
|
||||
// Editions maps edition keys to their associated featuresets.
|
||||
const featureEditions = {};
|
||||
featureEditions.oss = {
|
||||
...baseEdition,
|
||||
byow: true,
|
||||
'json-credentials': true,
|
||||
'static-credentials': true,
|
||||
'target-worker-filters-v2': true,
|
||||
'target-network-address': true,
|
||||
};
|
||||
featureEditions.enterprise = {
|
||||
...featureEditions.oss,
|
||||
'ssh-target': true,
|
||||
'target-worker-filters-v2-ingress': true,
|
||||
'vault-worker-filter': true,
|
||||
};
|
||||
featureEditions.hcp = {
|
||||
...featureEditions.enterprise,
|
||||
'byow-pki-hcp-cluster-id': true,
|
||||
'target-worker-filters-v2-hcp': true,
|
||||
};
|
||||
|
||||
/**
|
||||
* Takes a set of features and enables them in all editions.
|
||||
* For use in development and testing only.
|
||||
*/
|
||||
const enableFeaturesInAllEditions = (features = {}, ENV) => {
|
||||
Object.entries(featureEditions).forEach(
|
||||
([key, edition]) => (ENV.featureEditions[key] = { ...features, ...edition })
|
||||
);
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
featureEditions,
|
||||
selectedEdition,
|
||||
enableFeaturesInAllEditions,
|
||||
};
|
||||
@@ -47,7 +47,6 @@ module('Acceptance | workers | create', function (hooks) {
|
||||
assert.expect(2);
|
||||
const featuresService = this.owner.lookup('service:features');
|
||||
featuresService.enable('byow-pki-hcp-cluster-id');
|
||||
featuresService.disable('byow-pki-upstream');
|
||||
await visit(newWorkerURL);
|
||||
const labels = findAll('label.rose-form-label');
|
||||
assert.dom(labels[0]).hasText('Boundary Cluster ID');
|
||||
@@ -58,7 +57,6 @@ module('Acceptance | workers | create', function (hooks) {
|
||||
assert.expect(2);
|
||||
const featuresService = this.owner.lookup('service:features');
|
||||
featuresService.disable('byow-pki-hcp-cluster-id');
|
||||
featuresService.enable('byow-pki-upstream');
|
||||
await visit(newWorkerURL);
|
||||
const labels = findAll('label.rose-form-label');
|
||||
assert.dom(labels[0]).doesNotIncludeText('Boundary Cluster ID');
|
||||
|
||||
@@ -21,7 +21,6 @@ module(
|
||||
hooks.beforeEach(function () {
|
||||
const featuresService = this.owner.lookup('service:features');
|
||||
featuresService.enable('byow-pki-hcp-cluster-id');
|
||||
featuresService.disable('byow-pki-upstream');
|
||||
});
|
||||
|
||||
test('it correctly populates the cluster id for an hcp dev cluster', async function (assert) {
|
||||
|
||||
Reference in new issue
Block a user