Skip to content

Commit 04544be

Browse files
committed
feat: support & require RH OIDC auth
1 parent 9ae9ccd commit 04544be

File tree

5 files changed

+828
-447
lines changed

5 files changed

+828
-447
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist

package-lock.json

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@
7676
"command": "rhda.stackLogs",
7777
"title": "Debug logs",
7878
"category": "Red Hat Dependency Analytics"
79+
},
80+
{
81+
"command": "rhda.authenticate",
82+
"title": "Authenticate",
83+
"category": "Red Hat Dependency Analytics"
7984
}
8085
],
8186
"menus": {
@@ -436,6 +441,7 @@
436441
"json-to-ast": "^2.1.0",
437442
"minimatch": "^10.0.3",
438443
"mustache": "^4.2.0",
444+
"openid-client": "^6.8.0",
439445
"path": "^0.12.7",
440446
"tree-sitter-python": "^0.23.6",
441447
"web-tree-sitter": "^0.25.6"

src/caStatusBarProvider.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,49 @@ class CAStatusBarProvider implements Disposable {
4747
this.statusBarItem.tooltip = PromptText.LSP_FAILURE_TEXT;
4848
}
4949

50+
/**
51+
* Shows authentication required status in the status bar.
52+
*/
53+
public showAuthRequired(): void {
54+
this.statusBarItem.text = `$(shield) RHDA: Sign In Required`;
55+
this.statusBarItem.command = {
56+
title: 'Authenticate with RHDA',
57+
command: 'rhda.authenticate',
58+
};
59+
this.statusBarItem.tooltip = 'RHDA features are disabled. Click to authenticate and enable dependency analysis.';
60+
this.statusBarItem.show();
61+
}
62+
63+
/**
64+
* Shows authenticated status in the status bar.
65+
*/
66+
public showAuthenticated(): void {
67+
this.statusBarItem.text = `$(verified) RHDA: Authenticated`;
68+
this.statusBarItem.command = undefined; // No command needed when authenticated
69+
this.statusBarItem.tooltip = 'RHDA is authenticated and ready for dependency analysis';
70+
this.statusBarItem.show();
71+
}
72+
73+
/**
74+
* Shows session expired status in the status bar.
75+
*/
76+
public showSessionExpired(): void {
77+
this.statusBarItem.text = `$(warning) RHDA: Session Expired`;
78+
this.statusBarItem.command = {
79+
title: 'Re-authenticate with RHDA',
80+
command: 'rhda.authenticate',
81+
};
82+
this.statusBarItem.tooltip = 'Your RHDA session has expired. Click to re-authenticate and restore functionality.';
83+
this.statusBarItem.show();
84+
}
85+
86+
/**
87+
* Hides the status bar item.
88+
*/
89+
public hide(): void {
90+
this.statusBarItem.hide();
91+
}
92+
5093
/**
5194
* Disposes of the status bar item.
5295
*/

0 commit comments

Comments
 (0)