Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5e8b50a

Browse files
committed
Enable OAuth2 provider management
1 parent4f27d79 commit5e8b50a

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

‎enterprise/coderd/oauth2.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99

1010
"github.com/google/uuid"
1111

12-
"github.com/coder/coder/v2/buildinfo"
1312
"github.com/coder/coder/v2/coderd/database"
1413
"github.com/coder/coder/v2/coderd/database/db2sdk"
1514
"github.com/coder/coder/v2/coderd/database/dbtime"
@@ -22,13 +21,6 @@ import (
2221

2322
func (api*API)oAuth2ProviderMiddleware(next http.Handler) http.Handler {
2423
returnhttp.HandlerFunc(func(rw http.ResponseWriter,r*http.Request) {
25-
if!buildinfo.IsDev() {
26-
httpapi.Write(r.Context(),rw,http.StatusForbidden, codersdk.Response{
27-
Message:"OAuth2 provider is under development.",
28-
})
29-
return
30-
}
31-
3224
api.entitlementsMu.RLock()
3325
entitled:=api.entitlements.Features[codersdk.FeatureOAuth2Provider].Entitlement!=codersdk.EntitlementNotEntitled
3426
api.entitlementsMu.RUnlock()

‎site/src/pages/DeploySettingsPage/Sidebar.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Globe from "@mui/icons-material/PublicOutlined";
77
importHubOutlinedIconfrom"@mui/icons-material/HubOutlined";
88
importVpnKeyOutlinedfrom"@mui/icons-material/VpnKeyOutlined";
99
importMonitorHeartOutlinedfrom"@mui/icons-material/MonitorHeartOutlined";
10-
//import Token from "@mui/icons-material/Token";
10+
importTokenfrom"@mui/icons-material/Token";
1111
import{typeFC}from"react";
1212
import{GitIcon}from"components/Icons/GitIcon";
1313
import{
@@ -33,10 +33,9 @@ export const Sidebar: FC = () => {
3333
<SidebarNavItemhref="external-auth"icon={GitIcon}>
3434
External Authentication
3535
</SidebarNavItem>
36-
{/* Not exposing this yet since token exchange is not finished yet.
3736
<SidebarNavItemhref="oauth2-provider/apps"icon={Token}>
3837
OAuth2 Applications
39-
</SidebarNavItem>*/}
38+
</SidebarNavItem>
4039
<SidebarNavItemhref="network"icon={Globe}>
4140
Network
4241
</SidebarNavItem>

‎site/src/pages/UserSettingsPage/Sidebar.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import AccountIcon from "@mui/icons-material/Person";
55
importAppearanceIconfrom"@mui/icons-material/Brush";
66
importScheduleIconfrom"@mui/icons-material/EditCalendarOutlined";
77
importSecurityIconfrom"@mui/icons-material/LockOutlined";
8+
importTokenfrom"@mui/icons-material/Token";
89
importtype{User}from"api/typesGenerated";
910
import{UserAvatar}from"components/UserAvatar/UserAvatar";
1011
import{
@@ -23,6 +24,7 @@ export const Sidebar: FC<SidebarProps> = ({ user }) => {
2324
const{ entitlements}=useDashboard();
2425
constshowSchedulePage=
2526
entitlements.features.advanced_template_scheduling.enabled;
27+
constshowOAuth2Page=entitlements.features.oauth2_provider.enabled;
2628

2729
return(
2830
<BaseSidebar>
@@ -53,6 +55,11 @@ export const Sidebar: FC<SidebarProps> = ({ user }) => {
5355
<SidebarNavItemhref="external-auth"icon={GitIcon}>
5456
External Authentication
5557
</SidebarNavItem>
58+
{showOAuth2Page&&(
59+
<SidebarNavItemhref="oauth2-provider"icon={Token}>
60+
OAuth2 Applications
61+
</SidebarNavItem>
62+
)}
5663
<SidebarNavItemhref="tokens"icon={VpnKeyOutlined}>
5764
Tokens
5865
</SidebarNavItem>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp