File tree 3 files changed +9
-11
lines changed
3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change 6
6
7
7
"github.com/google/uuid"
8
8
9
- "github.com/coder/coder/v2/buildinfo"
10
9
"github.com/coder/coder/v2/coderd/database"
11
10
"github.com/coder/coder/v2/coderd/database/db2sdk"
12
11
"github.com/coder/coder/v2/coderd/database/dbtime"
@@ -18,13 +17,6 @@ import (
18
17
19
18
func (api * API ) oAuth2ProviderMiddleware (next http.Handler ) http.Handler {
20
19
return http .HandlerFunc (func (rw http.ResponseWriter , r * http.Request ) {
21
- if ! buildinfo .IsDev () {
22
- httpapi .Write (r .Context (), rw , http .StatusForbidden , codersdk.Response {
23
- Message : "OAuth2 provider is under development." ,
24
- })
25
- return
26
- }
27
-
28
20
api .entitlementsMu .RLock ()
29
21
entitled := api .entitlements .Features [codersdk .FeatureOAuth2Provider ].Entitlement != codersdk .EntitlementNotEntitled
30
22
api .entitlementsMu .RUnlock ()
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import Globe from "@mui/icons-material/PublicOutlined";
7
7
import HubOutlinedIcon from "@mui/icons-material/HubOutlined" ;
8
8
import VpnKeyOutlined from "@mui/icons-material/VpnKeyOutlined" ;
9
9
import MonitorHeartOutlined from "@mui/icons-material/MonitorHeartOutlined" ;
10
- // import Token from "@mui/icons-material/Token";
10
+ import Token from "@mui/icons-material/Token" ;
11
11
import { type FC } from "react" ;
12
12
import { GitIcon } from "components/Icons/GitIcon" ;
13
13
import {
@@ -33,10 +33,9 @@ export const Sidebar: FC = () => {
33
33
< SidebarNavItem href = "external-auth" icon = { GitIcon } >
34
34
External Authentication
35
35
</ SidebarNavItem >
36
- { /* Not exposing this yet since token exchange is not finished yet.
37
36
< SidebarNavItem href = "oauth2-provider/apps" icon = { Token } >
38
37
OAuth2 Applications
39
- </SidebarNavItem>*/ }
38
+ </ SidebarNavItem >
40
39
< SidebarNavItem href = "network" icon = { Globe } >
41
40
Network
42
41
</ SidebarNavItem >
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import AccountIcon from "@mui/icons-material/Person";
5
5
import AppearanceIcon from "@mui/icons-material/Brush" ;
6
6
import ScheduleIcon from "@mui/icons-material/EditCalendarOutlined" ;
7
7
import SecurityIcon from "@mui/icons-material/LockOutlined" ;
8
+ import Token from "@mui/icons-material/Token" ;
8
9
import type { User } from "api/typesGenerated" ;
9
10
import { UserAvatar } from "components/UserAvatar/UserAvatar" ;
10
11
import {
@@ -23,6 +24,7 @@ export const Sidebar: FC<SidebarProps> = ({ user }) => {
23
24
const { entitlements } = useDashboard ( ) ;
24
25
const showSchedulePage =
25
26
entitlements . features . advanced_template_scheduling . enabled ;
27
+ const showOAuth2Page = entitlements . features . oauth2_provider . enabled ;
26
28
27
29
return (
28
30
< BaseSidebar >
@@ -42,6 +44,11 @@ export const Sidebar: FC<SidebarProps> = ({ user }) => {
42
44
< SidebarNavItem href = "external-auth" icon = { GitIcon } >
43
45
External Authentication
44
46
</ SidebarNavItem >
47
+ { showOAuth2Page && (
48
+ < SidebarNavItem href = "oauth2-provider" icon = { Token } >
49
+ OAuth2 Applications
50
+ </ SidebarNavItem >
51
+ ) }
45
52
{ showSchedulePage && (
46
53
< SidebarNavItem href = "schedule" icon = { ScheduleIcon } >
47
54
Schedule
You can’t perform that action at this time.
0 commit comments