Skip to content

Commit 7770017

Browse files
authored
Merge pull request #29 from fleetbase/dev-v0.1.10
v0.1.10
2 parents 60bf10a + cd53091 commit 7770017

83 files changed

Lines changed: 4712 additions & 2925 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,19 @@ on:
88
pull_request:
99
branches: [ main ]
1010

11+
env:
12+
NODE_VERSION: 22.x
13+
1114
jobs:
1215
build:
1316
runs-on: ubuntu-latest
14-
15-
strategy:
16-
matrix:
17-
node-version: [18.x] # Build on Node.js 18
18-
1917
steps:
2018
- uses: actions/checkout@v2
2119

22-
- name: Setup Node.js ${{ matrix.node-version }}
20+
- name: Setup Node.js ${{ env.NODE_VERSION }}
2321
uses: actions/setup-node@v2
2422
with:
25-
node-version: ${{ matrix.node-version }}
23+
node-version: ${{ env.NODE_VERSION }}
2624

2725
- name: Setup pnpm
2826
uses: pnpm/action-setup@v2.0.1
@@ -45,10 +43,10 @@ jobs:
4543
steps:
4644
- uses: actions/checkout@v2
4745

48-
- name: Setup Node.js 18.x
46+
- name: Setup Node.js ${{ env.NODE_VERSION }}
4947
uses: actions/setup-node@v2
5048
with:
51-
node-version: 18.x
49+
node-version: ${{ env.NODE_VERSION }}
5250

5351
- name: Setup pnpm
5452
uses: pnpm/action-setup@v2.0.1
@@ -74,10 +72,10 @@ jobs:
7472
steps:
7573
- uses: actions/checkout@v2
7674

77-
- name: Setup Node.js 18.x
75+
- name: Setup Node.js ${{ env.NODE_VERSION }}
7876
uses: actions/setup-node@v2
7977
with:
80-
node-version: 18.x
78+
node-version: ${{ env.NODE_VERSION }}
8179

8280
- name: Setup pnpm
8381
uses: pnpm/action-setup@v2.0.1
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Widget::IamDashboardWidget @endpoint="access-coverage" @title="Access Coverage" @subtitle="Assignment coverage by user" @icon="shield-user" as |data|>
2+
<div class="iam-coverage-hero">
3+
<span>{{data.coverage}}%</span>
4+
<small>Users with access assignments</small>
5+
</div>
6+
<div class="iam-row-list mt-3">
7+
<div class="iam-row"><span>With roles</span><strong>{{data.with_roles}}</strong></div>
8+
<div class="iam-row"><span>With groups</span><strong>{{data.with_groups}}</strong></div>
9+
<div class="iam-row"><span>With policies</span><strong>{{data.with_policies}}</strong></div>
10+
<div class="iam-row"><span>Direct permissions</span><strong>{{data.with_direct_permissions}}</strong></div>
11+
<div class="iam-row iam-row-warning"><span>No assignments</span><strong>{{data.without_assignments}}</strong></div>
12+
</div>
13+
</Widget::IamDashboardWidget>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Component from '@glimmer/component';
2+
3+
export default class WidgetAccessCoverageComponent extends Component {}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Widget::IamDashboardWidget @endpoint="privileged-access" @title="Access Risk" @subtitle="Privileged exposure requiring review" @icon="user-lock" as |data|>
2+
<div class="iam-stat-grid iam-stat-grid-3 iam-risk-summary">
3+
<div class="iam-stat-card"><span>{{data.privileged_roles_count}}</span><small>Admin roles</small></div>
4+
<div class="iam-stat-card"><span>{{data.wildcard_policies_count}}</span><small>Wildcard policies</small></div>
5+
<div class="iam-stat-card"><span>{{data.direct_privileged_grants}}</span><small>Direct grants</small></div>
6+
</div>
7+
<div class="iam-scroll-list mt-3">
8+
{{#each data.roles as |role|}}
9+
<div class="iam-list-row iam-risk-row">
10+
<div class="min-w-0">
11+
<div class="iam-list-title">{{role.name}}</div>
12+
<div class="iam-list-subtitle">{{role.type}}</div>
13+
</div>
14+
<strong>{{role.permissions_count}}</strong>
15+
</div>
16+
{{else}}
17+
<div class="iam-widget-empty">No privileged access risks detected</div>
18+
{{/each}}
19+
</div>
20+
</Widget::IamDashboardWidget>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Component from '@glimmer/component';
2+
3+
export default class WidgetAccessRiskComponent extends Component {}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Widget::IamDashboardWidget @endpoint="group-coverage" @title="Group Coverage" @subtitle="Membership distribution" @icon="people-group" as |data|>
2+
<div class="iam-stat-grid iam-stat-grid-3">
3+
<div class="iam-stat-card"><span>{{data.total_groups}}</span><small>Groups</small></div>
4+
<div class="iam-stat-card"><span>{{data.total_memberships}}</span><small>Memberships</small></div>
5+
<div class="iam-stat-card"><span>{{data.empty_groups}}</span><small>Empty</small></div>
6+
</div>
7+
<div class="iam-row-list mt-3">
8+
{{#each data.buckets as |bucket|}}
9+
<div class="iam-row"><span>{{bucket.label}}</span><strong>{{bucket.value}}</strong></div>
10+
{{/each}}
11+
</div>
12+
</Widget::IamDashboardWidget>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Component from '@glimmer/component';
2+
3+
export default class WidgetGroupCoverageComponent extends Component {}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<div class="iam-dashboard-widget flex h-full min-h-0 flex-col overflow-hidden rounded-md border shadow-sm {{@class}}" ...attributes>
2+
<div class="iam-widget-header">
3+
<div class="min-w-0">
4+
<div class="iam-widget-title">{{@title}}</div>
5+
{{#if @subtitle}}
6+
<div class="iam-widget-subtitle">{{@subtitle}}</div>
7+
{{/if}}
8+
</div>
9+
{{#if @icon}}
10+
<div class="iam-widget-icon">
11+
<FaIcon @icon={{@icon}} @prefix={{or @iconPrefix "fas"}} />
12+
</div>
13+
{{/if}}
14+
</div>
15+
16+
<div class="iam-widget-body">
17+
{{#if this.load.isRunning}}
18+
<div class="iam-widget-empty">
19+
<Spinner />
20+
</div>
21+
{{else if this.error}}
22+
<div class="iam-widget-empty text-rose-600 dark:text-rose-300">{{this.error}}</div>
23+
{{else}}
24+
{{yield this.data}}
25+
{{/if}}
26+
</div>
27+
</div>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import Component from '@glimmer/component';
2+
import { tracked } from '@glimmer/tracking';
3+
import { inject as service } from '@ember/service';
4+
import { task } from 'ember-concurrency';
5+
6+
export default class WidgetIamDashboardWidgetComponent extends Component {
7+
@service fetch;
8+
9+
@tracked data = null;
10+
@tracked error = null;
11+
12+
constructor() {
13+
super(...arguments);
14+
this.load.perform();
15+
}
16+
17+
get params() {
18+
return this.args.params ?? {};
19+
}
20+
21+
@task *load() {
22+
try {
23+
this.data = yield this.fetch.get(`metrics/iam/${this.args.endpoint}`, this.params);
24+
this.error = null;
25+
} catch (error) {
26+
this.error = error?.message ?? 'Unable to load widget';
27+
}
28+
}
29+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<div class="iam-dashboard-widget iam-kpi-tile {{this.accentClass}} flex h-full min-h-0 flex-col justify-between overflow-hidden rounded-md border shadow-sm p-3" ...attributes>
2+
<div class="flex items-start justify-between gap-3">
3+
<div class="min-w-0">
4+
<div class="iam-kpi-title">{{@title}}</div>
5+
{{#if this.error}}
6+
<div class="mt-2 truncate text-xs font-semibold text-rose-600 dark:text-rose-300">{{this.error}}</div>
7+
{{else if this.load.isRunning}}
8+
<div class="mt-3"><Spinner /></div>
9+
{{else}}
10+
<div class="iam-kpi-value mt-2 truncate">{{this.value}}</div>
11+
{{/if}}
12+
</div>
13+
<div class="iam-kpi-icon">
14+
<FaIcon @icon={{@icon}} @prefix={{or @iconPrefix "fas"}} />
15+
</div>
16+
</div>
17+
18+
<div class="iam-kpi-footer">
19+
<span class="truncate">{{this.footnote}}</span>
20+
</div>
21+
</div>

0 commit comments

Comments
 (0)