File tree 2 files changed +13
-23
lines changed
pkg/analyzer/analyzers/launchdarkly
2 files changed +13
-23
lines changed Original file line number Diff line number Diff line change @@ -129,17 +129,16 @@ func secretInfoResourceToAnalyzerResource(resource Resource) *analyzers.Resource
129
129
130
130
// getPermissionType return what type of permission is assigned to token
131
131
func getPermissionType (token Token ) string {
132
- permission := ""
133
-
134
- if token .Role != "" {
135
- permission = token .Role
136
- } else if token .hasInlineRole () {
137
- permission = "Inline Policy"
138
- } else if token .hasCustomRoles () {
139
- permission = "Custom Roles"
132
+ switch {
133
+ case token .Role != "" :
134
+ return token .Role
135
+ case token .hasInlineRole ():
136
+ return "Inline Policy"
137
+ case token .hasCustomRoles ():
138
+ return "Custom Roles"
139
+ default :
140
+ return ""
140
141
}
141
-
142
- return permission
143
142
}
144
143
145
144
// printUser print User information from secret info to cli
Original file line number Diff line number Diff line change 23
23
type SecretInfo struct {
24
24
User User
25
25
Permissions []string
26
- Resources [] Resource
27
- // to concurrently read and write
28
- mu sync. RWMutex
26
+
27
+ mu sync. RWMutex
28
+ Resources [] Resource
29
29
}
30
30
31
31
// User is the information about the user to whom the token belongs
@@ -60,16 +60,7 @@ type CustomRole struct {
60
60
AssignedToTeams int
61
61
}
62
62
63
- /*
64
- policy is a set of statements
65
-
66
- Jargon:
67
- - Resource: List of resources
68
- - NotResources: Except this list of resources
69
- - Actions: List of actions
70
- - NotActions: Except this list of actions
71
- - Effect: Allowed or Denied
72
- */
63
+ // policy is a set of statements
73
64
type Policy struct {
74
65
Resources []string
75
66
NotResources []string
You can’t perform that action at this time.
0 commit comments