Skip to content

Commit e7f6831

Browse files
committed
Enable OAuth2 provider management
1 parent fa0f800 commit e7f6831

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
@@ -6,7 +6,6 @@ import (
66

77
"github.com/google/uuid"
88

9-
"github.com/coder/coder/v2/buildinfo"
109
"github.com/coder/coder/v2/coderd/database"
1110
"github.com/coder/coder/v2/coderd/database/db2sdk"
1211
"github.com/coder/coder/v2/coderd/database/dbtime"
@@ -19,13 +18,6 @@ import (
1918

2019
func (api *API) oAuth2ProviderMiddleware(next http.Handler) http.Handler {
2120
return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
22-
if !buildinfo.IsDev() {
23-
httpapi.Write(r.Context(), rw, http.StatusForbidden, codersdk.Response{
24-
Message: "OAuth2 provider is under development.",
25-
})
26-
return
27-
}
28-
2921
api.entitlementsMu.RLock()
3022
entitled := api.entitlements.Features[codersdk.FeatureOAuth2Provider].Entitlement != codersdk.EntitlementNotEntitled
3123
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
import HubOutlinedIcon from "@mui/icons-material/HubOutlined";
88
import VpnKeyOutlined from "@mui/icons-material/VpnKeyOutlined";
99
import MonitorHeartOutlined from "@mui/icons-material/MonitorHeartOutlined";
10-
// import Token from "@mui/icons-material/Token";
10+
import Token from "@mui/icons-material/Token";
1111
import { type FC } from "react";
1212
import { GitIcon } from "components/Icons/GitIcon";
1313
import {
@@ -33,10 +33,9 @@ export const Sidebar: FC = () => {
3333
<SidebarNavItem href="external-auth" icon={GitIcon}>
3434
External Authentication
3535
</SidebarNavItem>
36-
{/* Not exposing this yet since token exchange is not finished yet.
3736
<SidebarNavItem href="oauth2-provider/apps" icon={Token}>
3837
OAuth2 Applications
39-
</SidebarNavItem>*/}
38+
</SidebarNavItem>
4039
<SidebarNavItem href="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
import AppearanceIcon from "@mui/icons-material/Brush";
66
import ScheduleIcon from "@mui/icons-material/EditCalendarOutlined";
77
import SecurityIcon from "@mui/icons-material/LockOutlined";
8+
import Token from "@mui/icons-material/Token";
89
import type { 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
const showSchedulePage =
2526
entitlements.features.advanced_template_scheduling.enabled;
27+
const showOAuth2Page = entitlements.features.oauth2_provider.enabled;
2628

2729
return (
2830
<BaseSidebar>
@@ -42,6 +44,11 @@ export const Sidebar: FC<SidebarProps> = ({ user }) => {
4244
<SidebarNavItem href="external-auth" icon={GitIcon}>
4345
External Authentication
4446
</SidebarNavItem>
47+
{showOAuth2Page && (
48+
<SidebarNavItem href="oauth2-provider" icon={Token}>
49+
OAuth2 Applications
50+
</SidebarNavItem>
51+
)}
4552
{showSchedulePage && (
4653
<SidebarNavItem href="schedule" icon={ScheduleIcon}>
4754
Schedule

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy