Skip to content

Commit 53d9c68

Browse files
authored
Merge pull request #3 from replicatedhq/access
Add AccessApplications
2 parents 329e277 + 7146647 commit 53d9c68

20 files changed

+1590
-2
lines changed
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
2+
---
3+
apiVersion: apiextensions.k8s.io/v1
4+
kind: CustomResourceDefinition
5+
metadata:
6+
annotations:
7+
controller-gen.kubebuilder.io/version: v0.2.8
8+
creationTimestamp: null
9+
name: accessapplications.crds.kubeflare.io
10+
spec:
11+
group: crds.kubeflare.io
12+
names:
13+
kind: AccessApplication
14+
listKind: AccessApplicationList
15+
plural: accessapplications
16+
singular: accessapplication
17+
scope: Namespaced
18+
versions:
19+
- name: v1alpha1
20+
schema:
21+
openAPIV3Schema:
22+
description: DNSRecord is the Schema for the accessapplication API
23+
properties:
24+
apiVersion:
25+
description: 'APIVersion defines the versioned schema of this representation
26+
of an object. Servers should convert recognized schemas to the latest
27+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
28+
type: string
29+
kind:
30+
description: 'Kind is a string value representing the REST resource this
31+
object represents. Servers may infer this from the endpoint the client
32+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
33+
type: string
34+
metadata:
35+
type: object
36+
spec:
37+
description: AccessApplicationSpec defines the desired state of AccessApplication
38+
properties:
39+
accessPolicies:
40+
items:
41+
properties:
42+
descision:
43+
type: string
44+
exclude:
45+
items:
46+
type: string
47+
type: array
48+
include:
49+
items:
50+
type: string
51+
type: array
52+
name:
53+
type: string
54+
precendence:
55+
type: integer
56+
require:
57+
items:
58+
type: string
59+
type: array
60+
required:
61+
- descision
62+
- include
63+
- name
64+
type: object
65+
type: array
66+
allowedIdPs:
67+
items:
68+
type: string
69+
type: array
70+
autoRedirectToIndentiy:
71+
type: boolean
72+
corsHeaders:
73+
properties:
74+
allowAllHeaders:
75+
type: boolean
76+
allowAllMethods:
77+
type: boolean
78+
allowAllOrigins:
79+
type: boolean
80+
allowCredentials:
81+
type: boolean
82+
allowedHeader:
83+
items:
84+
type: string
85+
type: array
86+
allowedMethods:
87+
items:
88+
type: string
89+
type: array
90+
allowedOrigins:
91+
items:
92+
type: string
93+
type: array
94+
maxAge:
95+
type: integer
96+
required:
97+
- allowAllHeaders
98+
- allowAllMethods
99+
- allowAllOrigins
100+
- allowCredentials
101+
- allowedHeader
102+
- allowedMethods
103+
- allowedOrigins
104+
- maxAge
105+
type: object
106+
domain:
107+
type: string
108+
name:
109+
type: string
110+
sessionDuration:
111+
type: string
112+
zone:
113+
type: string
114+
required:
115+
- domain
116+
- name
117+
- zone
118+
type: object
119+
status:
120+
description: AccessApplicationStatus defines the observed state of AccessApplicationS
121+
properties:
122+
applicationID:
123+
type: string
124+
type: object
125+
type: object
126+
served: true
127+
storage: true
128+
subresources:
129+
status: {}
130+
status:
131+
acceptedNames:
132+
kind: ""
133+
plural: ""
134+
conditions: []
135+
storedVersions: []
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
2+
---
3+
apiVersion: apiextensions.k8s.io/v1beta1
4+
kind: CustomResourceDefinition
5+
metadata:
6+
annotations:
7+
controller-gen.kubebuilder.io/version: v0.2.8
8+
creationTimestamp: null
9+
name: accessapplications.crds.kubeflare.io
10+
spec:
11+
group: crds.kubeflare.io
12+
names:
13+
kind: AccessApplication
14+
listKind: AccessApplicationList
15+
plural: accessapplications
16+
singular: accessapplication
17+
scope: Namespaced
18+
subresources:
19+
status: {}
20+
validation:
21+
openAPIV3Schema:
22+
description: DNSRecord is the Schema for the accessapplication API
23+
properties:
24+
apiVersion:
25+
description: 'APIVersion defines the versioned schema of this representation
26+
of an object. Servers should convert recognized schemas to the latest
27+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
28+
type: string
29+
kind:
30+
description: 'Kind is a string value representing the REST resource this
31+
object represents. Servers may infer this from the endpoint the client
32+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
33+
type: string
34+
metadata:
35+
type: object
36+
spec:
37+
description: AccessApplicationSpec defines the desired state of AccessApplication
38+
properties:
39+
accessPolicies:
40+
items:
41+
properties:
42+
descision:
43+
type: string
44+
exclude:
45+
items:
46+
type: string
47+
type: array
48+
include:
49+
items:
50+
type: string
51+
type: array
52+
name:
53+
type: string
54+
precendence:
55+
type: integer
56+
require:
57+
items:
58+
type: string
59+
type: array
60+
required:
61+
- descision
62+
- include
63+
- name
64+
type: object
65+
type: array
66+
allowedIdPs:
67+
items:
68+
type: string
69+
type: array
70+
autoRedirectToIndentiy:
71+
type: boolean
72+
corsHeaders:
73+
properties:
74+
allowAllHeaders:
75+
type: boolean
76+
allowAllMethods:
77+
type: boolean
78+
allowAllOrigins:
79+
type: boolean
80+
allowCredentials:
81+
type: boolean
82+
allowedHeader:
83+
items:
84+
type: string
85+
type: array
86+
allowedMethods:
87+
items:
88+
type: string
89+
type: array
90+
allowedOrigins:
91+
items:
92+
type: string
93+
type: array
94+
maxAge:
95+
type: integer
96+
required:
97+
- allowAllHeaders
98+
- allowAllMethods
99+
- allowAllOrigins
100+
- allowCredentials
101+
- allowedHeader
102+
- allowedMethods
103+
- allowedOrigins
104+
- maxAge
105+
type: object
106+
domain:
107+
type: string
108+
name:
109+
type: string
110+
sessionDuration:
111+
type: string
112+
zone:
113+
type: string
114+
required:
115+
- domain
116+
- name
117+
- zone
118+
type: object
119+
status:
120+
description: AccessApplicationStatus defines the observed state of AccessApplicationS
121+
properties:
122+
applicationID:
123+
type: string
124+
type: object
125+
type: object
126+
version: v1alpha1
127+
versions:
128+
- name: v1alpha1
129+
served: true
130+
storage: true
131+
status:
132+
acceptedNames:
133+
kind: ""
134+
plural: ""
135+
conditions: []
136+
storedVersions: []

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ require (
2121
github.com/xo/dburl v0.0.0-20200124232849-e9ec94f52bc3
2222
go.uber.org/zap v1.10.0
2323
gopkg.in/yaml.v2 v2.2.8
24+
gotest.tools v2.2.0+incompatible
2425
k8s.io/api v0.18.0
2526
k8s.io/apiextensions-apiserver v0.18.0
2627
k8s.io/apimachinery v0.18.0

go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,7 @@ gopkg.in/yaml.v3 v3.0.0-20190905181640-827449938966 h1:B0J02caTR6tpSJozBJyiAzT6C
596596
gopkg.in/yaml.v3 v3.0.0-20190905181640-827449938966/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
597597
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
598598
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
599+
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
599600
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
600601
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
601602
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
Copyright 2019 Replicated, Inc.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1
18+
19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
)
22+
23+
type AccessPolicy struct {
24+
Decision string `json:"descision"`
25+
Name string `json:"name"`
26+
Include []string `json:"include"` // TODO
27+
Precedence *int `json:"precendence,omitempty"`
28+
Exclude []string `json:"exclude,omitempty"` // TODO
29+
Require []string `json:"require,omitempty"` // TODO
30+
}
31+
32+
type CORSHeader struct {
33+
AllowedMethods []string `json:"allowedMethods"`
34+
AllowedOrigins []string `json:"allowedOrigins"`
35+
AllowedHeaders []string `json:"allowedHeader"`
36+
AllowAllMethods bool `json:"allowAllMethods"`
37+
AllowAllOrigins bool `json:"allowAllOrigins"`
38+
AllowAllHeaders bool `json:"allowAllHeaders"`
39+
AllowCredentials bool `json:"allowCredentials"`
40+
MaxAge int `json:"maxAge"`
41+
}
42+
43+
// AccessApplicationSpec defines the desired state of AccessApplication
44+
type AccessApplicationSpec struct {
45+
Zone string `json:"zone"`
46+
Name string `json:"name"`
47+
Domain string `json:"domain"`
48+
SessionDuration string `json:"sessionDuration,omitempty"`
49+
AllowedIdPs []string `json:"allowedIdPs,omitempty"`
50+
AutoRedirectToIdentity *bool `json:"autoRedirectToIndentiy,omitempty"`
51+
CORSHeaders *CORSHeader `json:"corsHeaders,omitempty"`
52+
AccessPolicies []AccessPolicy `json:"accessPolicies,omitempty"`
53+
}
54+
55+
// AccessApplicationStatus defines the observed state of AccessApplicationS
56+
type AccessApplicationStatus struct {
57+
ApplicationID string `json:"applicationID,omitempty"`
58+
}
59+
60+
// +genclient
61+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
62+
63+
// DNSRecord is the Schema for the accessapplication API
64+
// +k8s:openapi-gen=true
65+
// +kubebuilder:subresource:status
66+
type AccessApplication struct {
67+
metav1.TypeMeta `json:",inline"`
68+
metav1.ObjectMeta `json:"metadata,omitempty"`
69+
70+
Spec AccessApplicationSpec `json:"spec,omitempty"`
71+
Status AccessApplicationStatus `json:"status,omitempty"`
72+
}
73+
74+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
75+
76+
// AccessApplicationList contains a list of DNSRecord
77+
type AccessApplicationList struct {
78+
metav1.TypeMeta `json:",inline"`
79+
metav1.ListMeta `json:"metadata,omitempty"`
80+
Items []DNSRecord `json:"items"`
81+
}
82+
83+
func init() {
84+
SchemeBuilder.Register(&AccessApplication{}, &AccessApplicationList{})
85+
}

0 commit comments

Comments
 (0)