@@ -77,10 +77,6 @@ const (
77
77
// Subject is a struct that contains all the elements of a subject in an rbac
78
78
// authorize.
79
79
type Subject struct {
80
- // Type indicates what kind of subject this is (user, system, provisioner, etc.)
81
- // It is not used in any functional way, only for logging.
82
- Type SubjectType
83
-
84
80
// FriendlyName is entirely optional and is used for logging and debugging
85
81
// It is not used in any functional way.
86
82
// It is usually the "username" of the user, but it can be the name of the
@@ -98,6 +94,10 @@ type Subject struct {
98
94
99
95
// cachedASTValue is the cached ast value for this subject.
100
96
cachedASTValue ast.Value
97
+
98
+ // Type indicates what kind of subject this is (user, system, provisioner, etc.)
99
+ // It is not used in any functional way, only for logging.
100
+ Type SubjectType
101
101
}
102
102
103
103
// RegoValueOk is only used for unit testing. There is no easy way
@@ -360,11 +360,10 @@ func NewAuthorizer(registry prometheus.Registerer) *RegoAuthorizer {
360
360
}
361
361
362
362
type authSubject struct {
363
- Type SubjectType `json:"type"`
364
- ID string `json:"id"`
365
- Roles []Role `json:"roles"`
366
- Groups []string `json:"groups"`
367
- Scope Scope `json:"scope"`
363
+ ID string `json:"id"`
364
+ Roles []Role `json:"roles"`
365
+ Groups []string `json:"groups"`
366
+ Scope Scope `json:"scope"`
368
367
}
369
368
370
369
// Authorize is the intended function to be used outside this package.
0 commit comments