diff --git a/addons/api/addon/models/worker.js b/addons/api/addon/models/worker.js
index e08909020..a210ff597 100644
--- a/addons/api/addon/models/worker.js
+++ b/addons/api/addon/models/worker.js
@@ -37,12 +37,13 @@ export default class WorkerModel extends GeneratedWorkerModel {
config_tags;
/**
- * Method to modify the adpater to handle custom POST route for creating worker.
+ * Method to modify the adapter to handle custom POST route for creating worker.
+ * @param {string} workerGeneratedAuthToken
* @param {object} options
* @param {object} options.adapterOptions
* @return {Promise}
*/
- addWorkerLed(workerGeneratedAuthToken, options = { adapterOptions: {} }) {
+ createWorkerLed(workerGeneratedAuthToken, options = { adapterOptions: {} }) {
const defaultAdapterOptions = {
method: 'create:worker-led',
workerGeneratedAuthToken,
diff --git a/addons/api/addon/serializers/worker.js b/addons/api/addon/serializers/worker.js
index 54f8099a2..f7545cc39 100644
--- a/addons/api/addon/serializers/worker.js
+++ b/addons/api/addon/serializers/worker.js
@@ -30,7 +30,7 @@ export default class WorkerSerializer extends ApplicationSerializer {
*/
serializeWithGeneratedToken(snapshot, workerGeneratedAuthToken) {
return {
- version: snapshot.attr('version'),
+ scope_id: snapshot.attr('scope').scope_id,
worker_generated_auth_token: workerGeneratedAuthToken,
};
}
diff --git a/addons/api/mirage/config.js b/addons/api/mirage/config.js
index 33b310494..a200b4260 100644
--- a/addons/api/mirage/config.js
+++ b/addons/api/mirage/config.js
@@ -645,6 +645,16 @@ export default function () {
this.get('/workers/:id');
this.del('/workers/:id');
this.patch('/workers/:id');
+ this.post('/workers:create:worker-led', ({ workers, scopes }) => {
+ const globalScope = scopes.find('global');
+
+ // This POST only takes in a token so we need to generate a random worker to return
+ const newWorker = this.create('worker', {
+ type: 'pki',
+ scope: globalScope,
+ });
+ return workers.create(newWorker.attrs);
+ });
/* Uncomment the following line and the Response import above
* Then change the response code to simulate error responses.
diff --git a/addons/api/tests/unit/models/worker-test.js b/addons/api/tests/unit/models/worker-test.js
index 9e0bd5292..a43d2cabb 100644
--- a/addons/api/tests/unit/models/worker-test.js
+++ b/addons/api/tests/unit/models/worker-test.js
@@ -6,19 +6,29 @@ module('Unit | Model | worker', function (hooks) {
setupTest(hooks);
setupMirage(hooks);
- test('it has an `addWorkerLed` method that targets a specific POST API', async function (assert) {
+ test('it has a `createWorkerLed` method that targets a specific POST API', async function (assert) {
assert.expect(2);
+
+ const scopeId = 'global';
+ const workerGeneratedAuthToken = 'token';
this.server.post('/v1/workers:create:worker-led', (schema, request) => {
const body = JSON.parse(request.requestBody);
assert.deepEqual(body, {
- worker_generated_auth_token: 'token',
+ scope_id: scopeId,
+ worker_generated_auth_token: workerGeneratedAuthToken,
});
return { id: '123abc' };
});
const store = this.owner.lookup('service:store');
- const model = store.createRecord('worker', { type: 'pki' });
- await model.addWorkerLed('token');
+ const model = store.createRecord('worker', {
+ type: 'pki',
+ scope: {
+ scope_id: scopeId,
+ type: 'global',
+ },
+ });
+ await model.createWorkerLed(workerGeneratedAuthToken);
const worker = store.peekRecord('worker', '123abc');
assert.ok(worker);
});
diff --git a/addons/api/tests/unit/serializers/worker-test.js b/addons/api/tests/unit/serializers/worker-test.js
index 5b93be295..5bfdeb000 100644
--- a/addons/api/tests/unit/serializers/worker-test.js
+++ b/addons/api/tests/unit/serializers/worker-test.js
@@ -23,12 +23,17 @@ module('Unit | Serializer | worker', function (hooks) {
});
test('it serializes using `adapterOptions.workerGeneratedAuthToken`', function (assert) {
+ const scopeId = 'global';
const store = this.owner.lookup('service:store');
const serializer = store.serializerFor('worker');
const record = store.createRecord('worker', {
name: 'worker',
description: 'Description',
version: 1,
+ scope: {
+ scope_id: scopeId,
+ type: 'global',
+ },
});
const snapshot = record._createSnapshot();
snapshot.adapterOptions = {
@@ -36,7 +41,7 @@ module('Unit | Serializer | worker', function (hooks) {
};
const serializedRecord = serializer.serialize(snapshot);
assert.deepEqual(serializedRecord, {
- version: 1,
+ scope_id: scopeId,
worker_generated_auth_token: '123-abc',
});
});
diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml
index d8dca572b..80ce5e0fa 100644
--- a/addons/core/translations/resources/en-us.yaml
+++ b/addons/core/translations/resources/en-us.yaml
@@ -26,7 +26,7 @@ auth-method:
title: No Auth Methods
description: No auth methods were found for this scope.
no-primary-auth-method:
- title: "Recommendation: Select a Primary Auth Method"
+ title: 'Recommendation: Select a Primary Auth Method'
description: A primary auth method auto-creates users when they authenticate for the first time. Scopes without primary auth methods may experience authentication failures.
pending:
title: Authentication Pending
@@ -52,7 +52,7 @@ auth-method:
questions:
make-primary: Make primary auth method?
remove-as-primary: Remove primary auth method?
- make-primary-confirm: "A primary auth method auto-creates users on their first authentication attempt if needed. Note: if you change the primary auth method, the previous primary will no longer auto-create users."
+ make-primary-confirm: 'A primary auth method auto-creates users on their first authentication attempt if needed. Note: if you change the primary auth method, the previous primary will no longer auto-create users.'
remove-as-primary-confirm: Removing the primary auth method may lead to authentication failures for this scope.
no-see-window: Don't see the new window?
group:
@@ -436,9 +436,40 @@ worker:
title: Worker
title_plural: Workers
description: Workers are the server components that perform the session handling.
+ actions:
+ register: Register Worker
messages:
welcome:
title: Welcome to Workers
table:
session_count: Session Count
ip_address: IP Address
+ form:
+ cluster_id:
+ label: Boundary Cluster ID
+ help: The cluster ID is the UUID in the HCP Boundary Controller URL
+ ip_address:
+ label: IP Address
+ help: The public IP address of the server
+ config_file_path:
+ label: Config file path
+ help: The path on your server where you will store your configuration file
+ worker_tags:
+ label: Worker Tags
+ help: Boundary can use tags to define key-value pairs which targets can use to determine where they should route connections
+ steps:
+ 1:
+ title: 1. Create a config file
+ create_directory: Create a configuration file in a new directory on your server
+ create_config: 'Open the file with a text editor, such as Vi. Paste the following configuration into the worker config file:'
+ save_config: Save the configuration in your `pki-worker.hcl` file.
+ 2:
+ title: 2. Install & start Boundary on your server
+ run_command: 'Run this command on your server to install Boundary:'
+ copy_registration_request: When the server starts, it will print details related to this worker. Copy the value for
+ 3:
+ title: 3. Confirm the worker when they connect
+ worker_auth_registration_request:
+ label: Worker Auth Registration Request
+ help: The registration key provided by this worker when it started
+ registered: Registered
diff --git a/addons/rose/addon/styles/rose/components/code-editor/_index.scss b/addons/rose/addon/styles/rose/components/code-editor/_index.scss
index 962da8eff..2c6fb86b9 100644
--- a/addons/rose/addon/styles/rose/components/code-editor/_index.scss
+++ b/addons/rose/addon/styles/rose/components/code-editor/_index.scss
@@ -31,8 +31,6 @@
display: flex;
justify-content: space-between;
align-items: center;
- background-color: var(--ui-gray-subtler-6);
- border-top: 1px solid var(--ui-gray-subtler-3);
border-bottom: 1px solid var(--ui-gray-subtler-3);
height: 2.75rem;
@@ -72,6 +70,7 @@
margin-right: sizing.rems(xs);
margin-left: sizing.rems(s);
height: sizing.rems(xl);
+ white-space: nowrap;
&-icon {
margin-right: sizing.rems(xs);
diff --git a/addons/rose/addon/styles/rose/components/layout/_page.scss b/addons/rose/addon/styles/rose/components/layout/_page.scss
index 568e1b776..b6abb4efc 100644
--- a/addons/rose/addon/styles/rose/components/layout/_page.scss
+++ b/addons/rose/addon/styles/rose/components/layout/_page.scss
@@ -32,6 +32,7 @@
.rose-layout-page-body {
grid-area: body;
+ width: 100%;
}
}
diff --git a/ui/admin/app/components/form/worker/create-worker-led/index.hbs b/ui/admin/app/components/form/worker/create-worker-led/index.hbs
new file mode 100644
index 000000000..6f12393f0
--- /dev/null
+++ b/ui/admin/app/components/form/worker/create-worker-led/index.hbs
@@ -0,0 +1,127 @@
+
+
+
+
+
+
+
+
+
+