Compare commits

..
1 Commits
Author SHA1 Message Date
hashicc cd3fc5cea7 fix: 🐛 apply .sr-only fix to all instances 2025-12-11 10:08:17 -08:00
2279 changed files with 8107 additions and 10425 deletions

No files matched your search

+2 -1
View File
@@ -2,12 +2,13 @@ schema_version = 1
project { project {
license = "BUSL-1.1" license = "BUSL-1.1"
copyright_year = 2021 copyright_year = 2024
# (OPTIONAL) A list of globs that should not have copyright/license headers. # (OPTIONAL) A list of globs that should not have copyright/license headers.
# Supports doublestar glob patterns for more flexibility in defining which # Supports doublestar glob patterns for more flexibility in defining which
# files or folders should be ignored # files or folders should be ignored
header_ignore = [ header_ignore = [
".github/**",
".husky/**", ".husky/**",
"**/node_modules/**", "**/node_modules/**",
"**/dist/**", "**/dist/**",
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright IBM Corp. 2021, 2026 # Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1 # SPDX-License-Identifier: BUSL-1.1
contact_links: contact_links:
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright IBM Corp. 2021, 2026 # Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1 # SPDX-License-Identifier: BUSL-1.1
addons: addons:
+2 -3
View File
@@ -1,8 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright IBM Corp. 2021, 2026 # Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1 # SPDX-License-Identifier: BUSL-1.1
set -euo pipefail set -euo pipefail
# Configure Git # Configure Git
@@ -92,4 +91,4 @@ gh pr create \
-b "${BASE_BRANCH/oss\//} upstream merge of (${SHA::7})" -b "${BASE_BRANCH/oss\//} upstream merge of (${SHA::7})"
gh pr merge --auto --merge gh pr merge --auto --merge
# This PR will be need to be approved manually # This PR will be need to be approved manually
+4 -4
View File
@@ -13,14 +13,14 @@ jobs:
runs-on: ${{ fromJSON(vars.RUNNER) }} runs-on: ${{ fromJSON(vars.RUNNER) }}
timeout-minutes: 40 timeout-minutes: 40
steps: steps:
- uses: browser-actions/setup-chrome@4f8e94349a351df0f048634f25fec36c3c91eded # v2.1.1 - uses: browser-actions/setup-chrome@b94431e051d1c52dcbe9a7092a4f10f827795416 # v2.1.0
with: with:
install-dependencies: true install-dependencies: true
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 #v4.2.0 - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 #v4.2.0
with: with:
run_install: false run_install: false
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with: with:
node-version: 20 node-version: 20
cache: 'pnpm' cache: 'pnpm'
@@ -41,7 +41,7 @@ jobs:
- name: Output ember a11y test report summary (desktop) - name: Output ember a11y test report summary (desktop)
run: 'cat ember-a11y-reports/desktop.json | jq "map({moduleName,testName,routes,urls,violations: .violations | map({id, nodes: .nodes | map({failureSummary, targets: .[].[]?.relatedNodes?.[]?.target? })}) })"' run: 'cat ember-a11y-reports/desktop.json | jq "map({moduleName,testName,routes,urls,violations: .violations | map({id, nodes: .nodes | map({failureSummary, targets: .[].[]?.relatedNodes?.[]?.target? })}) })"'
- name: Upload ember a11y reports - name: Upload ember a11y reports
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with: with:
name: ember-a11y-reports name: ember-a11y-reports
path: ./ember-a11y-reports path: ./ember-a11y-reports
+12 -12
View File
@@ -11,11 +11,11 @@ jobs:
name: Install dependencies name: Install dependencies
runs-on: ${{ fromJSON(vars.RUNNER) }} runs-on: ${{ fromJSON(vars.RUNNER) }}
steps: steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 #v4.2.0 - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 #v4.2.0
with: with:
run_install: false run_install: false
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with: with:
node-version: 20 node-version: 20
cache: 'pnpm' cache: 'pnpm'
@@ -26,12 +26,12 @@ jobs:
needs: [dependencies] needs: [dependencies]
runs-on: ${{ fromJSON(vars.RUNNER) }} runs-on: ${{ fromJSON(vars.RUNNER) }}
steps: steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 #v4.2.0 - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 #v4.2.0
with: with:
run_install: false run_install: false
- name: Build - name: Build
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with: with:
node-version: 20 node-version: 20
cache: 'pnpm' cache: 'pnpm'
@@ -39,12 +39,12 @@ jobs:
- run: pnpm install --offline - run: pnpm install --offline
- run: pnpm run build:ui:admin:oss - run: pnpm run build:ui:admin:oss
- name: Upload artifact admin-ui - name: Upload artifact admin-ui
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with: with:
name: admin-ui name: admin-ui
path: ./ui/admin/dist/ path: ./ui/admin/dist/
- name: Upload artifact OSS admin UI - name: Upload artifact OSS admin UI
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with: with:
name: admin-ui-oss name: admin-ui-oss
path: ./ui/admin/dist/ path: ./ui/admin/dist/
@@ -53,12 +53,12 @@ jobs:
needs: [dependencies] needs: [dependencies]
runs-on: ${{ fromJSON(vars.RUNNER) }} runs-on: ${{ fromJSON(vars.RUNNER) }}
steps: steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 #v4.2.0 - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 #v4.2.0
with: with:
run_install: false run_install: false
- name: Build - name: Build
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with: with:
node-version: 20 node-version: 20
cache: 'pnpm' cache: 'pnpm'
@@ -66,7 +66,7 @@ jobs:
- run: pnpm install --offline - run: pnpm install --offline
- run: pnpm run build:ui:admin:enterprise - run: pnpm run build:ui:admin:enterprise
- name: Upload artifact enterprise admin UI - name: Upload artifact enterprise admin UI
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with: with:
name: admin-ui-ent name: admin-ui-ent
path: ./ui/admin/dist/ path: ./ui/admin/dist/
@@ -75,12 +75,12 @@ jobs:
needs: [dependencies] needs: [dependencies]
runs-on: ${{ fromJSON(vars.RUNNER) }} runs-on: ${{ fromJSON(vars.RUNNER) }}
steps: steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 #v4.2.0 - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 #v4.2.0
with: with:
run_install: false run_install: false
- name: Build - name: Build
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with: with:
node-version: 20 node-version: 20
cache: 'pnpm' cache: 'pnpm'
@@ -88,7 +88,7 @@ jobs:
- run: pnpm install --offline - run: pnpm install --offline
- run: pnpm run build:ui:admin:hcp - run: pnpm run build:ui:admin:hcp
- name: Upload artifact HCP admin UI - name: Upload artifact HCP admin UI
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with: with:
name: admin-ui-hcp name: admin-ui-hcp
path: ./ui/admin/dist/ path: ./ui/admin/dist/
+1 -6
View File
@@ -30,12 +30,7 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up Node
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: 20
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
+2 -2
View File
@@ -6,7 +6,7 @@ jobs:
permissions: permissions:
contents: write contents: write
steps: steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
# Ref and repository aren't normally needed, this is a workaround for a bug in auto commit # Ref and repository aren't normally needed, this is a workaround for a bug in auto commit
with: with:
ref: ${{ github.event.pull_request.head.ref }} ref: ${{ github.event.pull_request.head.ref }}
@@ -14,6 +14,6 @@ jobs:
- uses: hashicorp/setup-copywrite@32638da2d4e81d56a0764aa1547882fc4d209636 # v1.1.3 - uses: hashicorp/setup-copywrite@32638da2d4e81d56a0764aa1547882fc4d209636 # v1.1.3
- name: Add missing Copyright Headers - name: Add missing Copyright Headers
run: copywrite headers run: copywrite headers
- uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0 - uses: stefanzweifel/git-auto-commit-action@28e16e81777b558cc906c8750092100bbb34c5e3 # v7.0.0
with: with:
commit_message: Add missing copyright headers commit_message: Add missing copyright headers
+107
View File
@@ -0,0 +1,107 @@
on:
issues:
types: [opened, closed, deleted, reopened]
pull_request_target:
types: [opened, closed, reopened]
issue_comment: # Also triggers when commenting on a PR from the conversation view
types: [created]
workflow_dispatch:
name: Jira Sync
jobs:
sync:
runs-on: ${{ fromJSON(vars.RUNNER) }}
name: Jira sync
steps:
- name: Check if community user
if: github.event.action == 'opened'
id: boundary-team-role
run: |
TEAM=boundary
ROLE="$(gh api orgs/hashicorp/teams/${TEAM}/memberships/${{ github.actor }} | jq -r '.role | select(.!=null)')"
if [[ -n ${ROLE} ]]; then
echo "Actor ${{ github.actor }} is a ${TEAM} team member, skipping ticket creation"
else
echo "Actor ${{ github.actor }} is not a ${TEAM} team member"
fi
echo "role=${ROLE}" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.JIRA_SYNC_GITHUB_TOKEN }}
- name: Set ticket type
if: github.event.action == 'opened' && !steps.boundary-team-role.outputs.role
id: set-ticket-type
run: |
if [[ "${{ github.event_name }}" == "pull_request_target" ]]; then
echo "type=PR" >> $GITHUB_OUTPUT
else
echo "type=ISS" >> $GITHUB_OUTPUT
fi
- name: Create ticket
if: github.event.action == 'opened' && !steps.boundary-team-role.outputs.role
uses: tomhjp/gh-action-jira-create@3ed1789cad3521292e591a7cfa703215ec1348bf # v0.2.1
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
with:
project: ICU
issuetype: "GH Issue"
summary: "${{ github.event.repository.name }} [${{ steps.set-ticket-type.outputs.type }} #${{ github.event.issue.number || github.event.pull_request.number }}]: ${{ github.event.issue.title || github.event.pull_request.title }}"
description: "${{ github.event.issue.body || github.event.pull_request.body }}\n\n_Created from GitHub Action for ${{ github.event.issue.html_url || github.event.pull_request.html_url }}, from ${{ github.actor }}_"
# customfield_10089 is Issue Link custom field
# customfield_10091 is team custom field
extraFields: '{"customfield_10089": "${{ github.event.issue.html_url || github.event.pull_request.html_url }}"}'
- name: Search
if: github.event.action != 'opened'
id: search
uses: tomhjp/gh-action-jira-search@04700b457f317c3e341ce90da5a3ff4ce058f2fa # v0.2.2
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
with:
# cf[10089] is Issue Link custom field
jql: 'issuetype = "GH Issue" and cf[10089]="${{ github.event.issue.html_url || github.event.pull_request.html_url }}"'
- name: Sync comment
if: github.event.action == 'created' && steps.search.outputs.issue
uses: tomhjp/gh-action-jira-comment@6eb6b9ead70221916b6badd118c24535ed220bd9 # v0.2.0
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
with:
issue: ${{ steps.search.outputs.issue }}
comment: "${{ github.actor }} ${{ github.event.review.state || 'commented' }}:\n\n${{ github.event.comment.body || github.event.review.body }}\n\n${{ github.event.comment.html_url || github.event.review.html_url }}"
- name: Transitions
id: transitions
if: steps.search.outputs.issue
run: |
if [[ "${{ github.event.action }}" == "closed" || "${{ github.event.action }}" == "deleted" ]]; then
echo "Closing ticket"
echo "name=Done" >> "$GITHUB_OUTPUT"
elif [[ "${{ github.event.action }}" == "reopened" ]]; then
echo "Reopening ticket"
echo "name=Reopen" >> "$GITHUB_OUTPUT"
fi
# Transition issue API reference: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-transitions-post
- name: Transition ticket
if: steps.transitions.outputs.name
run: |
transitions="$(curl --silent \
--url "${{ secrets.JIRA_BASE_URL }}rest/api/3/issue/${{ steps.search.outputs.issue }}/transitions" \
--user "${{ secrets.JIRA_USER_EMAIL }}:${{ secrets.JIRA_API_TOKEN }}" \
--header "Accept: application/json")"
id="$(echo "${transitions}" | jq -r '.transitions[] | select(.name == "${{ steps.transitions.outputs.name }}") | .id')"
curl --silent \
--url "${{ secrets.JIRA_BASE_URL }}rest/api/3/issue/${{ steps.search.outputs.issue }}/transitions" \
--user "${{ secrets.JIRA_USER_EMAIL }}:${{ secrets.JIRA_API_TOKEN }}" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data "$(printf '{"transition": {"id": "%s"}}' "${id}")"
+9 -9
View File
@@ -6,11 +6,11 @@ jobs:
name: Install dependencies name: Install dependencies
runs-on: ${{ fromJSON(vars.RUNNER) }} runs-on: ${{ fromJSON(vars.RUNNER) }}
steps: steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 #v4.2.0 - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 #v4.2.0
with: with:
run_install: false run_install: false
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with: with:
node-version: 20 node-version: 20
cache: 'pnpm' cache: 'pnpm'
@@ -22,11 +22,11 @@ jobs:
needs: [dependencies] needs: [dependencies]
runs-on: ${{ fromJSON(vars.RUNNER) }} runs-on: ${{ fromJSON(vars.RUNNER) }}
steps: steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 #v4.2.0 - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 #v4.2.0
with: with:
run_install: false run_install: false
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with: with:
node-version: 20 node-version: 20
cache: 'pnpm' cache: 'pnpm'
@@ -40,11 +40,11 @@ jobs:
runs-on: ${{ fromJSON(vars.RUNNER) }} runs-on: ${{ fromJSON(vars.RUNNER) }}
timeout-minutes: 5 timeout-minutes: 5
steps: steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 #v4.2.0 - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 #v4.2.0
with: with:
run_install: false run_install: false
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with: with:
node-version: 20 node-version: 20
cache: 'pnpm' cache: 'pnpm'
@@ -58,14 +58,14 @@ jobs:
runs-on: ${{ fromJSON(vars.RUNNER) }} runs-on: ${{ fromJSON(vars.RUNNER) }}
timeout-minutes: 15 timeout-minutes: 15
steps: steps:
- uses: browser-actions/setup-chrome@4f8e94349a351df0f048634f25fec36c3c91eded # v2.1.1 - uses: browser-actions/setup-chrome@b94431e051d1c52dcbe9a7092a4f10f827795416 # v2.1.0
with: with:
install-dependencies: true install-dependencies: true
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 #v4.2.0 - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 #v4.2.0
with: with:
run_install: false run_install: false
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with: with:
node-version: 20 node-version: 20
cache: 'pnpm' cache: 'pnpm'
+1 -1
View File
@@ -7,7 +7,7 @@ jobs:
runs-on: ${{ fromJSON(vars.RUNNER) }} runs-on: ${{ fromJSON(vars.RUNNER) }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with: with:
token: ${{ secrets.ELEVATED_GITHUB_TOKEN }} token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
- run: | - run: |
+21 -66
View File
@@ -26,10 +26,6 @@ on:
jobs: jobs:
test: test:
name: test name: test
# don't need to run e2e tests on ce -> ent merges since tests were already
# run in the ce branch, and there are currently no code diffferences between
# the two repos
if: github.actor != 'hc-github-team-secure-boundary'
runs-on: ${{ fromJSON(vars.RUNNER_UBUNTU_22) }} runs-on: ${{ fromJSON(vars.RUNNER_UBUNTU_22) }}
strategy: strategy:
matrix: matrix:
@@ -52,7 +48,7 @@ jobs:
env: env:
ENOS_VAR_e2e_debug_no_run: true ENOS_VAR_e2e_debug_no_run: true
steps: steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with: with:
fetch-depth: 0 fetch-depth: 0
@@ -62,7 +58,7 @@ jobs:
run_install: false run_install: false
- name: Set up Node - name: Set up Node
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with: with:
node-version: 20 node-version: 20
cache: "pnpm" cache: "pnpm"
@@ -71,21 +67,17 @@ jobs:
ui/desktop/electron-app/pnpm-lock.yaml ui/desktop/electron-app/pnpm-lock.yaml
- name: Set up Terraform - name: Set up Terraform
uses: hashicorp/setup-terraform@5e8dbf3c6d9deaf4193ca7a8fb23f2ac83bb6c85 uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd
- name: Set up Enos - name: Set up Enos
uses: hashicorp/action-setup-enos@17b90fcf9591275b468a94aefb9dc6a93017de8a uses: hashicorp/action-setup-enos@39a8f388434bea5eeba6649b99aa9949a55a1150
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Vault CLI - name: Install Vault CLI
run: | run: |
wget https://releases.hashicorp.com/vault/1.17.6/vault_1.17.6_linux_amd64.zip -O /tmp/vault.zip wget https://releases.hashicorp.com/vault/1.12.2/vault_1.12.2_linux_amd64.zip -O /tmp/vault.zip
if [[ "${{ github.repository }}" == "hashicorp/boundary-ui" ]]; then unzip /tmp/vault.zip -d /usr/local/bin
unzip -o -q /tmp/vault.zip -d /usr/local/bin
elif [[ "${{ github.repository }}" == "hashicorp/boundary-ui-enterprise" ]]; then
unzip -o -q /tmp/vault.zip -d "$HOME/bin"
fi
- name: GPG setup - name: GPG setup
run: | run: |
@@ -134,12 +126,10 @@ jobs:
echo "trusted-key $KEY_ID" >> ~/.gnupg/gpg.conf echo "trusted-key $KEY_ID" >> ~/.gnupg/gpg.conf
# Initialize the password store # Initialize the password store
sudo apt-get update
sudo apt-get install -y pass
pass init $KEY_ID &>/dev/null pass init $KEY_ID &>/dev/null
- name: Checkout ${{ matrix.folder_name }} repo - name: Checkout ${{ matrix.folder_name }} repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with: with:
repository: ${{ matrix.github_repo }} repository: ${{ matrix.github_repo }}
path: support/src/${{ matrix.folder_name }} path: support/src/${{ matrix.folder_name }}
@@ -148,12 +138,14 @@ jobs:
- name: GH fix for localhost resolution - name: GH fix for localhost resolution
run: | run: |
if [[ "${{ github.repository }}" == "hashicorp/boundary-ui" ]]; then cat /etc/hosts && echo "-----------"
cat /etc/hosts && echo "-----------" sudo sed -i 's/::1 *localhost ip6-localhost ip6-loopback/::1 ip6 -localhost ip6-loopback/g' /etc/hosts
sudo sed -i 's/::1 *localhost ip6-localhost ip6-loopback/::1 ip6 -localhost ip6-loopback/g' /etc/hosts cat /etc/hosts
cat /etc/hosts ssh -V
ssh -V
fi echo "127.0.0.1 localhost boundary" | sudo tee -a /etc/hosts
echo "127.0.0.1 localhost worker" | sudo tee -a /etc/hosts
echo "127.0.0.1 localhost vault" | sudo tee -a /etc/hosts
- name: Set git config - name: Set git config
run: | run: |
@@ -163,40 +155,15 @@ jobs:
run: | run: |
pnpm install --frozen-lockfile pnpm install --frozen-lockfile
cd e2e-tests cd e2e-tests
if [[ "${{ github.repository }}" == "hashicorp/boundary-ui" ]]; then pnpm playwright install --with-deps
pnpm playwright install --with-deps
elif [[ "${{ github.repository }}" == "hashicorp/boundary-ui-enterprise" ]]; then
# playwright dependencies can't be installed on a self-hosted runner
# due to permission issues
pnpm playwright install
fi
- name: Determine Go version
id: get-go-version
run: |
echo "Building with Go $(cat ./support/src/${{matrix.folder_name}}/.go-version)"
echo "go-version=$(cat ./support/src/${{matrix.folder_name}}/.go-version)" >> "$GITHUB_OUTPUT"
- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: ${{ steps.get-go-version.outputs.go-version }}
cache: false
- name: Set up test infra - name: Set up test infra
id: infra id: infra
run: | run: |
ssh-keygen -N '' -t ed25519 -f ~/.ssh/github_enos ssh-keygen -N '' -t ed25519 -f ~/.ssh/github_enos
mkdir -p ./enos/terraform-plugin-cache mkdir -p ./enos/terraform-plugin-cache
echo ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} > ./support/src/${{matrix.folder_name}}/internal/ui/VERSION
if [[ "${{ github.repository }}" == "hashicorp/boundary-ui" ]]; then export ENOS_VAR_ui_build_override="oss" && \
echo ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} > ./support/src/${{matrix.folder_name}}/internal/ui/VERSION
export ENOS_VAR_ui_build_override="oss"
elif [[ "${{ github.repository }}" == "hashicorp/boundary-ui-enterprise" ]]; then
echo ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} > ./support/src/${{matrix.folder_name}}/internal/ui/VERSION_ent
export ENOS_VAR_ui_build_override="enterprise"
fi
export ENOS_VAR_boundary_edition=${{ matrix.boundary_edition_short }} && \ export ENOS_VAR_boundary_edition=${{ matrix.boundary_edition_short }} && \
export ENOS_VAR_enos_user=$GITHUB_ACTOR && \ export ENOS_VAR_enos_user=$GITHUB_ACTOR && \
export ENOS_VAR_aws_ssh_private_key_path=~/.ssh/github_enos && \ export ENOS_VAR_aws_ssh_private_key_path=~/.ssh/github_enos && \
@@ -205,36 +172,24 @@ jobs:
- name: Move boundary binary - name: Move boundary binary
run: | run: |
if [[ "${{ github.repository }}" == "hashicorp/boundary-ui" ]]; then mv ./support/src/${{matrix.folder_name}}/bin/boundary /usr/local/bin/
mv ./support/src/${{matrix.folder_name}}/bin/boundary /usr/local/bin/
elif [[ "${{ github.repository }}" == "hashicorp/boundary-ui-enterprise" ]]; then
mv ./support/src/${{matrix.folder_name}}/bin/boundary $HOME/bin
fi
boundary version boundary version
- name: Run Tests - name: Run Tests
run: | run: |
source <(bash ./support/src/${{matrix.folder_name}}/enos/scripts/test_e2e_env.sh) source <(bash ./support/src/${{matrix.folder_name}}/enos/scripts/test_e2e_env.sh)
cd e2e-tests cd e2e-tests
if [[ "${{ github.repository }}" == "hashicorp/boundary-ui" ]]; then pnpm run ${{ matrix.test_command }} --reporter=html
pnpm run ${{ matrix.test_command }} --reporter=html
elif [[ "${{ github.repository }}" == "hashicorp/boundary-ui-enterprise" ]]; then
# only run tests on chromium because playwright dependencies can't
# be installed to support other browsers
pnpm run ${{ matrix.test_command }} --project=chromium --reporter=html
fi
- name: Upload Playwright report - name: Upload Playwright report
if: ${{ failure() }} if: ${{ failure() }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with: with:
name: playwright-report-${{ matrix.boundary_edition }} name: playwright-report-${{ matrix.boundary_edition }}
path: e2e-tests/playwright-report path: e2e-tests/playwright-report
- name: Clean up test infra - name: Clean up test infra
if: ${{ always() }} if: ${{ always() }}
continue-on-error: true
run: | run: |
export ENOS_VAR_boundary_edition=${{ matrix.boundary_edition_short }} && \ export ENOS_VAR_boundary_edition=${{ matrix.boundary_edition_short }} && \
export ENOS_VAR_enos_user=$GITHUB_ACTOR && \ export ENOS_VAR_enos_user=$GITHUB_ACTOR && \
+27 -89
View File
@@ -11,31 +11,17 @@ on:
- 'e2e-tests/desktop/**' - 'e2e-tests/desktop/**'
- '.github/workflows/test-e2e-desktop.yaml' - '.github/workflows/test-e2e-desktop.yaml'
workflow_dispatch: workflow_dispatch:
inputs:
boundary-enterprise-branch:
description: 'Branch of boundary-enterprise to test against (default to main)'
required: true
default: 'main'
type: string
boundary-ui-enterprise-branch:
description: 'Branch of boundary-ui-enterprise to test against (default to main)'
required: true
default: 'main'
type: string
jobs: jobs:
test: test:
name: test name: test
# don't need to run e2e tests on ce -> ent merges since tests were already
# run in the ce branch, and there are currently no code diffferences between
# the two repos
if: github.actor != 'hc-github-team-secure-boundary'
runs-on: ${{ fromJSON(vars.RUNNER_UBUNTU_22) }} runs-on: ${{ fromJSON(vars.RUNNER_UBUNTU_22) }}
env: env:
ENOS_VAR_boundary_edition: "ent" ENOS_VAR_boundary_edition: "ent"
ENOS_VAR_e2e_debug_no_run: true ENOS_VAR_e2e_debug_no_run: true
SETUP_CLI: true
steps: steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with: with:
fetch-depth: 0 fetch-depth: 0
@@ -45,7 +31,7 @@ jobs:
run_install: false run_install: false
- name: Set up Node - name: Set up Node
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with: with:
node-version: 20 node-version: 20
cache: "pnpm" cache: "pnpm"
@@ -54,130 +40,82 @@ jobs:
ui/desktop/electron-app/pnpm-lock.yaml ui/desktop/electron-app/pnpm-lock.yaml
- name: Set up Terraform - name: Set up Terraform
uses: hashicorp/setup-terraform@5e8dbf3c6d9deaf4193ca7a8fb23f2ac83bb6c85 uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd
- name: Set up Enos - name: Set up Enos
uses: hashicorp/action-setup-enos@17b90fcf9591275b468a94aefb9dc6a93017de8a uses: hashicorp/action-setup-enos@39a8f388434bea5eeba6649b99aa9949a55a1150
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Vault CLI - name: Install Vault CLI
run: | run: |
wget https://releases.hashicorp.com/vault/1.17.6/vault_1.17.6_linux_amd64.zip -O /tmp/vault.zip wget https://releases.hashicorp.com/vault/1.12.2/vault_1.12.2_linux_amd64.zip -O /tmp/vault.zip
if [[ "${{ github.repository }}" == "hashicorp/boundary-ui" ]]; then unzip /tmp/vault.zip -d /usr/local/bin
unzip -o -q /tmp/vault.zip -d /usr/local/bin
elif [[ "${{ github.repository }}" == "hashicorp/boundary-ui-enterprise" ]]; then
unzip -o -q /tmp/vault.zip -d "$HOME/bin"
fi
# TODO: We should consider modifying to also build CE binary. For now
# building ENT binary using most recent UI commit is sufficient.
- name: Checkout boundary-enterprise - name: Checkout boundary-enterprise
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with: with:
repository: hashicorp/boundary-enterprise repository: hashicorp/boundary-enterprise
ref: ${{ github.event.inputs.boundary-enterprise-branch || 'main' }} # ref: ${{ github.event.inputs.boundary-enterprise-branch }}
path: support/src/boundary-enterprise path: support/src/boundary-enterprise
token: ${{ secrets.ELEVATED_GITHUB_TOKEN }} token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
- name: Checkout boundary-ui-enterprise
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: hashicorp/boundary-ui-enterprise
ref: ${{ github.event.inputs.boundary-ui-enterprise-branch || 'main' }}
path: support/src/boundary-ui-enterprise
token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
- name: Use boundary-ui-enterprise commit SHA for building binary
run: |
cd support/src/boundary-ui-enterprise
git rev-parse HEAD > ../boundary-enterprise/internal/ui/VERSION_ent
- name: GH fix for localhost resolution - name: GH fix for localhost resolution
run: | run: |
if [[ "${{ github.repository }}" == "hashicorp/boundary-ui" ]]; then cat /etc/hosts && echo "-----------"
cat /etc/hosts && echo "-----------" sudo sed -i 's/::1 *localhost ip6-localhost ip6-loopback/::1 ip6 -localhost ip6-loopback/g' /etc/hosts
sudo sed -i 's/::1 *localhost ip6-localhost ip6-loopback/::1 ip6 -localhost ip6-loopback/g' /etc/hosts cat /etc/hosts
cat /etc/hosts ssh -V
ssh -V
fi
- name: Set git config echo "127.0.0.1 localhost boundary" | sudo tee -a /etc/hosts
echo "127.0.0.1 localhost worker" | sudo tee -a /etc/hosts
echo "127.0.0.1 localhost vault" | sudo tee -a /etc/hosts
# TODO: Build image ourselves in case we don't want to use latest?
- name: Get Boundary docker image
run: | run: |
git config --global url."https://oauth2:${{ secrets.ELEVATED_GITHUB_TOKEN }}@github.com".insteadOf "https://github.com" docker pull hashicorp/boundary-enterprise:latest
docker save hashicorp/boundary-enterprise:latest | gzip > /tmp/boundary-enterprise.zip
- name: Determine Go version
id: get-go-version
run: |
echo "Building with Go $(cat ./support/src/boundary-enterprise/.go-version)"
echo "go-version=$(cat ./support/src/boundary-enterprise/.go-version)" >> "$GITHUB_OUTPUT"
- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: ${{ steps.get-go-version.outputs.go-version }}
cache: false
- name: Set up test infra - name: Set up test infra
id: infra id: infra
run: | run: |
ssh-keygen -N '' -t ed25519 -f ~/.ssh/github_enos ssh-keygen -N '' -t ed25519 -f ~/.ssh/github_enos
mkdir -p ./enos/terraform-plugin-cache mkdir -p ./enos/terraform-plugin-cache
export ENOS_VAR_ui_build_override="ent" && \
export ENOS_VAR_boundary_edition="ent" && \
export ENOS_VAR_enos_user=$GITHUB_ACTOR && \ export ENOS_VAR_enos_user=$GITHUB_ACTOR && \
export ENOS_VAR_aws_ssh_private_key_path=~/.ssh/github_enos && \ export ENOS_VAR_aws_ssh_private_key_path=~/.ssh/github_enos && \
export ENOS_VAR_boundary_license="${{ secrets.BOUNDARY_ENT_LICENSE }}" && \ export ENOS_VAR_boundary_license="${{ secrets.BOUNDARY_ENT_LICENSE }}" && \
enos scenario launch --timeout 60m0s --chdir ./support/src/boundary-enterprise/enos e2e_ui_docker_ent builder:local export ENOS_VAR_boundary_docker_image_file=/tmp/boundary-enterprise.zip && \
enos scenario launch --timeout 60m0s --chdir ./support/src/boundary-enterprise/enos e2e_ui_docker_ent builder:crt
- name: Move boundary binary
run: |
if [[ "${{ github.repository }}" == "hashicorp/boundary-ui" ]]; then
mv ./support/src/boundary-enterprise/bin/boundary /usr/local/bin/
elif [[ "${{ github.repository }}" == "hashicorp/boundary-ui-enterprise" ]]; then
mv ./support/src/boundary-enterprise/bin/boundary $HOME/bin
fi
boundary version
- name: Install dependencies - name: Install dependencies
run: | run: |
pnpm install --frozen-lockfile pnpm install --frozen-lockfile
cd e2e-tests cd e2e-tests
if [[ "${{ github.repository }}" == "hashicorp/boundary-ui" ]]; then pnpm playwright install --with-deps
pnpm playwright install --with-deps
elif [[ "${{ github.repository }}" == "hashicorp/boundary-ui-enterprise" ]]; then
# playwright dependencies can't be installed on a self-hosted runner
# due to permission issues
pnpm playwright install
sudo apt update -qq
sudo apt install xvfb -y
fi
# Runner is headless so we need to enable a display to run the client # Runner is headless so we need to enable a display to run the client
- name: Run Tests - name: Run Tests
run: | run: |
source <(bash ./support/src/boundary-enterprise/enos/scripts/test_e2e_env.sh) source <(bash ./support/src/boundary-enterprise/enos/scripts/test_e2e_env.sh)
cd e2e-tests cd e2e-tests
export DISPLAY=:99 export DISPLAY=:99
Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
pnpm run desktop pnpm run desktop
- name: Upload Playwright report - name: Upload Playwright report
if: ${{ failure() }} if: ${{ failure() }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with: with:
name: playwright-report name: playwright-report
path: e2e-tests/playwright-report path: e2e-tests/playwright-report
- name: Clean up test infra - name: Clean up test infra
if: ${{ always() }} if: ${{ always() }}
continue-on-error: true
run: | run: |
export ENOS_VAR_enos_user=$GITHUB_ACTOR && \ export ENOS_VAR_enos_user=$GITHUB_ACTOR && \
export ENOS_VAR_aws_ssh_private_key_path=~/.ssh/github_enos && \ export ENOS_VAR_aws_ssh_private_key_path=~/.ssh/github_enos && \
enos scenario destroy --timeout 60m0s --chdir ./support/src/boundary-enterprise/enos e2e_ui_docker_ent builder:local enos scenario destroy --timeout 60m0s --chdir ./support/src/boundary-enterprise/enos e2e_ui_docker_ent builder:crt
- name: Send Slack message on failure - name: Send Slack message on failure
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1 uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1
+1 -1
View File
@@ -9,7 +9,7 @@ jobs:
trigger-gha-release: trigger-gha-release:
runs-on: ${{ fromJSON(vars.RUNNER) }} runs-on: ${{ fromJSON(vars.RUNNER) }}
steps: steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Release description - name: Release description
run: | run: |
echo "Triggering release with a TAG ${GITHUB_REF#refs/tags/}" echo "Triggering release with a TAG ${GITHUB_REF#refs/tags/}"
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright IBM Corp. 2021, 2026 # Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1 # SPDX-License-Identifier: BUSL-1.1
url_license = "https://github.com/hashicorp/boundary-ui/blob/main/LICENSE" url_license = "https://github.com/hashicorp/boundary-ui/blob/main/LICENSE"
+7 -7
View File
@@ -3,21 +3,21 @@ License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved.
Parameters Parameters
Licensor: International Business Machines Corporation (IBM) Licensor: HashiCorp, Inc.
Licensed Work: The Licensed Work is (c) 2024 IBM Corp. Licensed Work: The Licensed Work is (c) 2024 HashiCorp, Inc.
Additional Use Grant: You may make production use of the Licensed Work, provided Additional Use Grant: You may make production use of the Licensed Work, provided
Your use does not include offering the Licensed Work to third Your use does not include offering the Licensed Work to third
parties on a hosted or embedded basis in order to compete with parties on a hosted or embedded basis in order to compete with
IBM Corp's paid version(s) of the Licensed Work. For purposes HashiCorp's paid version(s) of the Licensed Work. For purposes
of this license: of this license:
A "competitive offering" is a Product that is offered to third A "competitive offering" is a Product that is offered to third
parties on a paid basis, including through paid support parties on a paid basis, including through paid support
arrangements, that significantly overlaps with the capabilities arrangements, that significantly overlaps with the capabilities
of IBM Corp's paid version(s) of the Licensed Work. If Your of HashiCorp's paid version(s) of the Licensed Work. If Your
Product is not a competitive offering when You first make it Product is not a competitive offering when You first make it
generally available, it will not become a competitive offering generally available, it will not become a competitive offering
later due to IBM Corp releasing a new version of the Licensed later due to HashiCorp releasing a new version of the Licensed
Work with additional capabilities. In addition, Products that Work with additional capabilities. In addition, Products that
are not provided on a paid basis are not competitive. are not provided on a paid basis are not competitive.
@@ -33,10 +33,10 @@ Additional Use Grant: You may make production use of the Licensed Work, provided
Hosting or using the Licensed Work(s) for internal purposes Hosting or using the Licensed Work(s) for internal purposes
within an organization is not considered a competitive within an organization is not considered a competitive
offering. IBM Corp considers your organization to include all offering. HashiCorp considers your organization to include all
of your affiliates under common control. of your affiliates under common control.
For binding interpretive guidance on using IBM Corp products For binding interpretive guidance on using HashiCorp products
under the Business Source License, please visit our FAQ. under the Business Source License, please visit our FAQ.
(https://www.hashicorp.com/license-faq) (https://www.hashicorp.com/license-faq)
Change Date: Four years from the date the Licensed Work is published. Change Date: Four years from the date the Licensed Work is published.
+14
View File
@@ -0,0 +1,14 @@
# unconventional js
/blueprints/*/files/
# compiled output
/declarations/
/dist/
# misc
/coverage/
!.*
.*/
# ember-try
/.node_modules.ember-try/
+69
View File
@@ -0,0 +1,69 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
'use strict';
module.exports = {
root: true,
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
// This is specific babel-config. If grows consider creating a babel config file
requireConfigFile: false,
babelOptions: {
plugins: [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
],
},
// end of babel-config
},
plugins: ['ember'],
extends: ['eslint:recommended', 'plugin:ember/recommended', 'prettier'],
env: {
browser: true,
},
rules: {
curly: ['error', 'multi-line', 'consistent'],
'ember/no-get': 'off',
'ember/no-get-with-default': 'off',
'ember/no-computed-properties-in-native-classes': 'off',
'ember/no-assignment-of-untracked-properties-used-in-tracking-contexts':
'off',
},
overrides: [
// node files
{
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./index.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./tests/dummy/config/**/*.js',
'./broccoli-plugins/**/*.js',
],
parserOptions: {
sourceType: 'script',
},
env: {
browser: false,
node: true,
},
extends: ['plugin:n/recommended'],
},
{
// test files
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
rules: {
'qunit/require-expect': [2, 'except-simple'],
},
},
],
};
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+5 -38
View File
@@ -21,50 +21,17 @@ This addon contains the API data access layer for Boundary.
## Add API to an App ## Add API to an App
Add this addon to an Ember application's `devDependencies` as: Add this addon to an Ember application's `devDependencies` as:
`"api": "workspace:*"`, for applications included in this monorepo. `"api": "workspace:*"`, for applications included in this monorepo.
This addon also includes Mirage mocks. To include the `miragejs` dependency and this addon's mirage handlers configure the consuming app's `config/environment.js` Since this addon also includes Mirage mocks, be sure to install
`ember-cli-mirage` and add the following config to your UI project:
```js ```js
mirage: { 'ember-cli-mirage': {
enabled: true directory: '../../addons/api/mirage'
} }
``` ```
Include `miragejs` and any api addon `peerDependencies` used by the mirage as dev dependencies in the consuming app,
eg: `@faker-js/faker`, otherwise mirage handler code might fail with an error.
To have mirage start and intercept requests when the application starts:
1. Add the `@embroider/macros` dependency to your application
2. Configure `@embroider/macros` with `startMirageWithApp` based on app's config within `ember-cli-build.js`:
```js
// ember-cli-build.js
module.exports = async function (defaults) {
// load the app's config
const { EMBER_ENV } = process.env;
var config = require('./config/environment')(EMBER_ENV);
const app = new EmberApp(defaults, {
'@embroider/macros': {
setOwnConfig: {
startMirageWithApp: config.mirage?.enabled ?? false
},
},
});
}
```
3. Finally, use the `@embroider/macros` config value for `startMirageWithApp` in `app/app.js` to conditionally start mirage:
```js
import { macroCondition, importSync, getOwnConfig, isTesting } from '@embroider/macros';
if (macroCondition(getOwnConfig().startMirageWithApp && !isTesting())) {
const startServer = importSync('[name of host app]/mirage/config').default;
startServer({});
}
```
## Installation ## Installation
See monorepo README for installation instructions. See monorepo README for installation instructions.
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -11,7 +11,7 @@ import { underscore } from '@ember/string';
/** /**
* This test helper can be used to help setup your sinon stubs in your tests. * This test helper can be used to help setup your sinon stubs in your tests.
* Must be called after setupMirage and setupDesktopContextBridgeApiMock in tests. * Must be called after setupMirage.
* *
* ```js * ```js
* import setupStubs from 'api/test-support/handlers/cache-daemon-search'; * import setupStubs from 'api/test-support/handlers/cache-daemon-search';
@@ -19,15 +19,14 @@ import { underscore } from '@ember/string';
* module('Acceptance | my test', function(hooks) { * module('Acceptance | my test', function(hooks) {
* setupApplicationTest(hooks); * setupApplicationTest(hooks);
* setupMirage(hooks); * setupMirage(hooks);
* setupDesktopContextBridgeApiMock(hooks);
* setupStubs(hooks); * setupStubs(hooks);
* *
* // add your actual tests here * // add your actual tests here
* }); * });
* ``` * ```
* *
* This will setup a stub for window.desktop.daemon.searchCacheDaemon and include * This will setup a stub for the IPC service and include helper methods to
* helper methods to help setup what the cache daemon search command returns. * help setup what the cache daemon search command returns.
* *
* @module Test Helpers * @module Test Helpers
* @public * @public
@@ -36,6 +35,9 @@ export default function setupStubs(hooks) {
let stubTypes = []; let stubTypes = [];
hooks.beforeEach(function () { hooks.beforeEach(function () {
const ipcService = this.owner.lookup('service:ipc');
this.ipcStub = sinon.stub(ipcService, 'invoke');
/** /**
* We aim to still use mirage data when stubbing out the cache daemon * We aim to still use mirage data when stubbing out the cache daemon
* search. However, the handler expects the search data to be raw JSON from * search. However, the handler expects the search data to be raw JSON from
@@ -54,32 +56,34 @@ export default function setupStubs(hooks) {
stubTypes = types; stubTypes = types;
types.forEach((type, i) => { types.forEach((type, i) => {
this.searchCacheDaemonStub.onCall(i).callsFake(() => { this.ipcStub
let models; .withArgs('searchCacheDaemon')
let resourceName; .onCall(i)
if (typeOf(type) === 'object') { .callsFake(() => {
models = type.func(); let models;
resourceName = type.resource; let resourceName;
} else { if (typeOf(type) === 'object') {
models = this.server.schema[type].all().models; models = type.func();
resourceName = type; resourceName = type.resource;
} } else {
models = this.server.schema[type].all().models;
resourceName = type;
}
return { return {
[underscore(resourceNames[singularize(resourceName)])]: models.map( [underscore(resourceNames[singularize(resourceName)])]:
(model) => { models.map((model) => {
// Use internal serializer to serialize the model correctly // Use internal serializer to serialize the model correctly
// according to our mirage serializers // according to our mirage serializers
const modelData = const modelData =
this.server.serializerOrRegistry.serialize(model); this.server.serializerOrRegistry.serialize(model);
// Serialize the data properly to standard JSON as that is what // Serialize the data properly to standard JSON as that is what
// we're expecting from the cache daemon response // we're expecting from the cache daemon response
return JSON.parse(JSON.stringify(modelData)); return JSON.parse(JSON.stringify(modelData));
}, }),
), };
}; });
});
}); });
}; };
}); });
@@ -87,19 +91,22 @@ export default function setupStubs(hooks) {
hooks.afterEach(function () { hooks.afterEach(function () {
// Verify the number of mocks we set up match with how // Verify the number of mocks we set up match with how
// many times the cache daemon was called with // many times the cache daemon was called with
sinon.assert.callCount(this.searchCacheDaemonStub, stubTypes.length); sinon.assert.callCount(
this.ipcStub.withArgs('searchCacheDaemon'),
stubTypes.length,
);
stubTypes.forEach((type, i) => { stubTypes.forEach((type, i) => {
// Assert that the stub was called with the resource we're trying to mock // Assert that the stub was called with the resource we're trying to mock
// so we don't mistakenly mock the wrong resource // so we don't mistakenly mock the wrong resource
const call = this.searchCacheDaemonStub.getCall(i); const ipcCall = this.ipcStub.withArgs('searchCacheDaemon').getCall(i);
let resource = type; let resource = type;
if (typeOf(type) === 'object') { if (typeOf(type) === 'object') {
resource = type.resource; resource = type.resource;
} }
const mappedResourceName = resourceNames[singularize(resource)]; const mappedResourceName = resourceNames[singularize(resource)];
sinon.assert.match(call.args[0], { resource: mappedResourceName }); sinon.assert.match(ipcCall.args[1], { resource: mappedResourceName });
}); });
sinon.restore(); sinon.restore();
@@ -1,34 +0,0 @@
/**
* Copyright IBM Corp. 2021, 2026
* SPDX-License-Identifier: BUSL-1.1
*/
import { settled } from '@ember/test-helpers';
export function createSetupMirage(startMirage) {
return function setupMirage(hooks) {
hooks.beforeEach(function () {
if (!this.owner) {
throw new Error(
'Must call one of the ember-qunit setupTest() / setupRenderingTest() / setupApplicationTest() first',
);
}
// the environment property here is configuration to the mirage server:
// https://github.com/miragejs/miragejs/blob/7ff4f3f6fe56bf0cb1648f5af3f5210fcb07e20b/types/index.d.ts#L383
// It is not related to ember's build environment. In this case for mirage the "test" environment does
// not load the default scenario:
// https://github.com/miragejs/miragejs/blob/7ff4f3f6fe56bf0cb1648f5af3f5210fcb07e20b/lib/server.js#L302
this.server = startMirage({ environment: 'test' });
});
hooks.afterEach(function () {
return settled().then(() => {
if (this.server) {
this.server.shutdown();
delete this.server;
}
});
});
};
}
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+3 -3
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -16,7 +16,7 @@ class InvalidRolePrincipalTypeError extends Error {
export default class RoleAbility extends ModelAbility { export default class RoleAbility extends ModelAbility {
// =services // =services
@service abilities; @service can;
// =permissions // =permissions
@@ -64,6 +64,6 @@ export default class RoleAbility extends ModelAbility {
`Expected a role principal of type 'user', 'group', or 'managed-group'. Got '${type}'.`, `Expected a role principal of type 'user', 'group', or 'managed-group'. Got '${type}'.`,
); );
} }
return this.abilities.can(`read ${type}`, this.model); return this.can.can(`read ${type}`, this.model);
} }
} }
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+2 -2
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -23,7 +23,7 @@ export default class HostCatalogAdapter extends ApplicationAdapter {
try { try {
const pluginName = snapshot.attr('plugin')?.name; const pluginName = snapshot.attr('plugin')?.name;
if (pluginName) url = `${url}?plugin_name=${pluginName}`; if (pluginName) url = `${url}?plugin_name=${pluginName}`;
} catch { } catch (e) {
// Ignore any adapter errors here // Ignore any adapter errors here
} }
} }
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -23,7 +23,7 @@ export default class SessionRecordingAdapter extends ApplicationAdapter {
let method; let method;
try { try {
method = snapshot?.adapterOptions?.method; method = snapshot?.adapterOptions?.method;
} catch { } catch (e) {
// Ignore any adapter errors here // Ignore any adapter errors here
} }
if (method === 'download') { if (method === 'download') {
+2 -2
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -22,7 +22,7 @@ export default class StorageBucketAdapter extends ApplicationAdapter {
let pluginName; let pluginName;
try { try {
pluginName = snapshot?.attr('plugin')?.name; pluginName = snapshot?.attr('plugin')?.name;
} catch { } catch (e) {
// Ignore any adapter errors here // Ignore any adapter errors here
} }
if (requestType === 'createRecord' && pluginName) { if (requestType === 'createRecord' && pluginName) {
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -72,7 +72,7 @@ export default class GeneratedHostCatalogModel extends BaseModel {
@attr('string', { @attr('string', {
for: { for: {
type: 'plugin', type: 'plugin',
name: ['aws', 'azure', 'gcp'], name: ['aws', 'gcp'],
}, },
description: description:
'An expression used to filter the workers that have network access to a service that is hosting the external object store.', 'An expression used to filter the workers that have network access to a service that is hosting the external object store.',
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -59,6 +59,7 @@ const fetchControllerData = async (context, next) => {
*/ */
export default class CacheDaemonHandler { export default class CacheDaemonHandler {
@service session; @service session;
@service ipc;
constructor(context) { constructor(context) {
setOwner(this, getOwner(context)); setOwner(this, getOwner(context));
@@ -69,8 +70,9 @@ export default class CacheDaemonHandler {
case 'query': { case 'query': {
const { store, data } = context.request; const { store, data } = context.request;
const { type, query, options: { pushToStore = true } = {} } = data; const { type, query, options: { pushToStore = true } = {} } = data;
const isCacheDaemonRunning = const isCacheDaemonRunning = await this.ipc.invoke(
await window.desktop.daemon.isCacheDaemonRunning(); 'isCacheDaemonRunning',
);
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
let { recursive, scope_id, page, pageSize, ...remainingQuery } = query; let { recursive, scope_id, page, pageSize, ...remainingQuery } = query;
@@ -99,14 +101,6 @@ export default class CacheDaemonHandler {
const token = sessionData?.token; const token = sessionData?.token;
const resourceName = resourceNames[type]; const resourceName = resourceNames[type];
if (remainingQuery.query?.sort) {
const { attribute, direction } = remainingQuery.query.sort;
if (attribute && direction) {
remainingQuery.sort_by = attribute;
remainingQuery.sort_direction = direction;
}
}
remainingQuery = { remainingQuery = {
...remainingQuery, ...remainingQuery,
query: searchQuery, query: searchQuery,
@@ -117,19 +111,23 @@ export default class CacheDaemonHandler {
let cacheDaemonResults = {}; let cacheDaemonResults = {};
try { try {
cacheDaemonResults = cacheDaemonResults = await this.ipc.invoke(
await window.desktop.daemon.searchCacheDaemon(remainingQuery); 'searchCacheDaemon',
remainingQuery,
);
} catch (e) { } catch (e) {
// If we got a 403, most likely the cache daemon was restarted and our token is no longer valid // If we got a 403, most likely the cache daemon was restarted and our token is no longer valid
// I'm not sure if we can get a 401 since we always send a token but we'll handle it in the same way // I'm not sure if we can get a 401 since we always send a token but we'll handle it in the same way
if (e.statusCode === 403 || e.statusCode === 401) { if (e.statusCode === 403 || e.statusCode === 401) {
try { try {
await window.desktop.daemon.addTokenToDaemons({ await this.ipc.invoke('addTokenToDaemons', {
tokenId: auth_token_id, tokenId: auth_token_id,
token, token,
}); });
cacheDaemonResults = cacheDaemonResults = await this.ipc.invoke(
await window.desktop.daemon.searchCacheDaemon(remainingQuery); 'searchCacheDaemon',
remainingQuery,
);
} catch (err) { } catch (err) {
// If it fails again just fall back to fetching controller data // If it fails again just fall back to fetching controller data
__electronLog?.error( __electronLog?.error(
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
+1 -1
View File
@@ -1,5 +1,5 @@
/** /**
* Copyright IBM Corp. 2021, 2026 * Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1 * SPDX-License-Identifier: BUSL-1.1
*/ */
Loaded 100 of 2279 files, more files were not shown because too many files have changed in this diff. Show more