forked from kiali/kiali
/
request_authentication.go
44 lines (39 loc) · 1.26 KB
/
request_authentication.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
32
33
34
35
36
37
38
39
40
41
42
43
44
package models
import (
"github.com/kiali/kiali/kubernetes"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// RequestAuthentications requestAuthentications
//
// This is used for returning an array of RequestAuthentication
//
// swagger:model requestAuthentications
// An array of requestAuthentication
// swagger:allOf
type RequestAuthentications []RequestAuthentication
// RequestAuthentication requestAuthentication
//
// This is used for returning an RequestAuthentication
//
// swagger:model requestAuthentication
type RequestAuthentication struct {
meta_v1.TypeMeta
Metadata meta_v1.ObjectMeta `json:"metadata"`
Spec struct {
Selector interface{} `json:"selector"`
JwtRules interface{} `json:"jwtRules"`
} `json:"spec"`
}
func (ras *RequestAuthentications) Parse(requestAuthentications []kubernetes.IstioObject) {
for _, reqAuth := range requestAuthentications {
ra := RequestAuthentication{}
ra.Parse(reqAuth)
*ras = append(*ras, ra)
}
}
func (ra *RequestAuthentication) Parse(requestAuthentication kubernetes.IstioObject) {
ra.TypeMeta = requestAuthentication.GetTypeMeta()
ra.Metadata = requestAuthentication.GetObjectMeta()
ra.Spec.Selector = requestAuthentication.GetSpec()["selector"]
ra.Spec.JwtRules = requestAuthentication.GetSpec()["jwtRules"]
}