-
Notifications
You must be signed in to change notification settings - Fork 51
/
apiservices.go
46 lines (40 loc) · 1.35 KB
/
apiservices.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 policy
import (
"github.com/aporeto-inc/trireme-lib/common"
)
// ServiceType are the types of services that can are suported.
type ServiceType int
// Values of ServiceType
const (
ServiceTCP ServiceType = iota
ServiceHTTP
ServiceL3
)
// ApplicationServicesList is a list of ApplicationServices.
type ApplicationServicesList []*ApplicationService
// ApplicationService is the type of service that this PU exposes.
type ApplicationService struct {
// NetworkInfo provides the network information (addresses/ports) of the service
NetworkInfo *common.Service
// Type is the type of the service.
Type ServiceType
// ApplicationRules are only valid for non TCP or L3 services
HTTPRules []*HTTPRule
// Tags are the tags of the service.
Tags *TagStore
// JWTCertificate is a certificate for validating JWT bearer tokens in http requests.
JWTCertificate []byte
}
// HTTPRule holds a rule for a particular HTTPService. The rule
// relates a set of URIs defined as regular expressions with associated
// verbs. The * VERB indicates all actions.
type HTTPRule struct {
// URIs is a list of regular expressions that describe the URIs
URIs []string
// Verbs is a list of the allowed verbs
Verbs []string
// Scopes is a list of scopes associated with this rule. Clients
// must present one of these scopes in order to get access to this
// API.
Scopes []string
}