chore: 🤖 manual merge from main

This commit is contained in:
Randall Morey committed 2021-03-06 10:34:44 -05:00
commit ea1c32ad8b
7 files changed
+27 -27

No files matched your search

+1 -1
View File
@@ -15,5 +15,5 @@ jobs:
echo "Triggering release with a TAG ${GITHUB_REF#refs/tags/}"
curl -u ${{ secrets.CIRCLE_TOKEN }}: -X POST --header "Content-Type: application/json" \
-d '{ "branch": "main", "parameters": {"TAG": "${GITHUB_REF#refs/tags/}" }}' \
-d '{ "branch": "main", "parameters": {"TAG": "'${GITHUB_REF#refs/tags/}'" }}' \
https://circleci.com/api/v2/project/github/hashicorp/boundary-ui-releases/pipeline
+1
View File
@@ -7,6 +7,7 @@ Canonical reference for changes, improvements, and bugfixes for Boundary Desktop
### New & Improved
- Changes to targets (like adding, removing) are rapidly reflected in Boundary Desktop. ([PR](https://github.com/hashicorp/boundary-ui/pull/487))
- Scrolling now occurs within columns individually so that sidebar and header remain visible when scrolling the application body. ([PR](https://github.com/hashicorp/boundary-ui/pull/482))
### Changes/Deprecations
@@ -1,11 +1,6 @@
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
export default class ScopesScopeProjectsSessionsIndexController extends Controller {
// =sessions
@service session;
// =attributes
/**
@@ -14,11 +9,8 @@ export default class ScopesScopeProjectsSessionsIndexController extends Controll
* @type {SessionModel[]}
*/
get sorted() {
const userId = this.session.data.authenticated.user_id;
const sessions = this.model;
const sortedSessions = sessions
// filter sessions by current user
.filter((session) => session.user_id === userId)
// sort by created time
.sortBy('session.created_time')
.reverse();
@@ -49,8 +49,13 @@ export default class ScopesScopeProjectsSessionsRoute extends Route {
*/
async model() {
const { id: scope_id } = this.modelFor('scopes.scope');
const { user_id } = this.session.data.authenticated;
await this.store.query('target', { recursive: true, scope_id });
return await this.store.query('session', { recursive: true, scope_id });
return await this.store.query('session', {
filter: `"/item/user_id" == "${user_id}"`,
recursive: true,
scope_id
});
}
/**
@@ -32,7 +32,7 @@ export default class ScopesScopeProjectsTargetsRoute extends Route {
@task(function * () {
while(true) {
yield timeout(POLL_TIMEOUT_SECONDS * 1000);
yield this.refreshSessions();
yield this.refresh();
}
/* eslint-disable-next-line prettier/prettier */
}).drop() poller;
@@ -52,18 +52,17 @@ export default class ScopesScopeProjectsTargetsRoute extends Route {
*/
async model() {
const { id: scope_id } = this.modelFor('scopes.scope');
await this.refreshSessions();
return this.store.query('target', { recursive: true, scope_id });
}
/**
* Loads all sessions for all scopes in order to prime the store.
* Targets peek into the store to determine if they are active.
* TODO: query only for sessions associated with the current user.
*/
async refreshSessions() {
const { id: scope_id } = this.modelFor('scopes.scope');
await this.store.query('session', { recursive: true, scope_id });
const { user_id } = this.session.data.authenticated;
await this.store.query('session', {
filter: `"/item/user_id" == "${user_id}"`,
recursive: true,
scope_id
});
return this.store.query('target', {
filter: '"authorize-session" in "/item/authorized_actions"',
recursive: true,
scope_id
});
}
/**
@@ -89,7 +88,7 @@ export default class ScopesScopeProjectsTargetsRoute extends Route {
*/
@action
async connect(model, host) {
// TODO: Connect: Refactor into an addon
// TODO: Connect: move this logic into the target model
try {
// Check for CLI
const cliExists = await this.ipc.invoke('cliExists');
+2 -1
View File
@@ -20,6 +20,7 @@ const escapeAndValidateBase62 = (str) => {
module.exports = {
// Check boundary cli existence
exists: () => Boolean(cliPath()),
// Initiate connection and return output
connect: (target_id, token, host_id) => {
const addr = origin.origin;
@@ -34,12 +35,12 @@ module.exports = {
`-token=${sanitized.token}`,
`-addr=${addr}`,
'-format=json',
'--output-json-errors',
];
if (host_id) command.push(`-host-id=${sanitized.host_id}`);
return spawnAsyncJSONPromise(command);
},
// Returns JSON-formatted version information from the CLI
version: () => {
const command = ['-v'];
+4 -2
View File
@@ -51,8 +51,10 @@ module.exports = {
childProcess.stderr.on('data', (data) => {
errorStream += data.toString();
const jsonData = jsonify(errorStream);
const error = jsonData ? jsonData.error : undefined;
if (jsonData) reject(new Error(error));
if (jsonData) {
const error = jsonData.api_error || jsonData.error;
reject(new Error(error));
}
});
});
},