forked from kyma-project/kyma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
interface.go
46 lines (35 loc) · 861 Bytes
/
interface.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
45
46
package v2
import (
"fmt"
kymaMeta "github.com/kyma-project/kyma/components/api-controller/pkg/apis/gateway.kyma.cx/meta/v1"
"github.com/kyma-project/kyma/components/api-controller/pkg/controller/meta"
)
type Interface interface {
Create(dto *Dto) (*kymaMeta.GatewayResource, error)
Update(oldDto, newDto *Dto) (*kymaMeta.GatewayResource, error)
Delete(dto *Dto) error
}
type JwtDefaultConfig Jwt
type Dto struct {
MetaDto meta.Dto
ServiceName string
AuthenticationEnabled bool
Rules Rules
Status kymaMeta.GatewayResourceStatus
}
type Rules []Rule
type Rule struct {
Type Type
Jwt Jwt
}
func (r *Rule) String() string {
return fmt.Sprintf("{Type: %s, Jwt: %s}", r.Type, r.Jwt)
}
type Type string
const (
JwtType Type = "JWT"
)
type Jwt struct {
Issuer string
JwksUri string
}