forked from openshift/oc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
oauth.go
31 lines (27 loc) · 818 Bytes
/
oauth.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package legacy
import (
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
oauthv1 "github.com/openshift/api/oauth/v1"
)
func InstallExternalLegacyOAuth(scheme *runtime.Scheme) {
schemeBuilder := runtime.NewSchemeBuilder(
addUngroupifiedOAuthTypes,
)
utilruntime.Must(schemeBuilder.AddToScheme(scheme))
}
func addUngroupifiedOAuthTypes(scheme *runtime.Scheme) error {
types := []runtime.Object{
&oauthv1.OAuthAccessToken{},
&oauthv1.OAuthAccessTokenList{},
&oauthv1.OAuthAuthorizeToken{},
&oauthv1.OAuthAuthorizeTokenList{},
&oauthv1.OAuthClient{},
&oauthv1.OAuthClientList{},
&oauthv1.OAuthClientAuthorization{},
&oauthv1.OAuthClientAuthorizationList{},
&oauthv1.OAuthRedirectReference{},
}
scheme.AddKnownTypes(GroupVersion, types...)
return nil
}