Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: return error in getUserPermissions() related APIs (#1358)
- Loading branch information
Showing
4 changed files
with
15 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5acc404
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
BenchmarkCachedRaw
17.63
ns/op 0 B/op 0 allocs/opBenchmarkCachedRaw - ns/op
17.63
ns/op17.57
ns/op1.00
BenchmarkCachedRaw - B/op
0
B/op0
B/op1
BenchmarkCachedRaw - allocs/op
0
allocs/op0
allocs/op1
BenchmarkCachedBasicModel
167
ns/op 104 B/op 4 allocs/opBenchmarkCachedBasicModel - ns/op
167
ns/op160.8
ns/op1.04
BenchmarkCachedBasicModel - B/op
104
B/op104
B/op1
BenchmarkCachedBasicModel - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedRBACModel
164.8
ns/op 104 B/op 4 allocs/opBenchmarkCachedRBACModel - ns/op
164.8
ns/op157.9
ns/op1.04
BenchmarkCachedRBACModel - B/op
104
B/op104
B/op1
BenchmarkCachedRBACModel - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedRBACModelSmall
174.1
ns/op 104 B/op 4 allocs/opBenchmarkCachedRBACModelSmall - ns/op
174.1
ns/op177.8
ns/op0.98
BenchmarkCachedRBACModelSmall - B/op
104
B/op104
B/op1
BenchmarkCachedRBACModelSmall - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedRBACModelMedium
176.3
ns/op 104 B/op 4 allocs/opBenchmarkCachedRBACModelMedium - ns/op
176.3
ns/op175.5
ns/op1.00
BenchmarkCachedRBACModelMedium - B/op
104
B/op104
B/op1
BenchmarkCachedRBACModelMedium - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedRBACModelLarge
164.5
ns/op 96 B/op 3 allocs/opBenchmarkCachedRBACModelLarge - ns/op
164.5
ns/op156.4
ns/op1.05
BenchmarkCachedRBACModelLarge - B/op
96
B/op96
B/op1
BenchmarkCachedRBACModelLarge - allocs/op
3
allocs/op3
allocs/op1
BenchmarkCachedRBACModelWithResourceRoles
166.4
ns/op 104 B/op 4 allocs/opBenchmarkCachedRBACModelWithResourceRoles - ns/op
166.4
ns/op163.7
ns/op1.02
BenchmarkCachedRBACModelWithResourceRoles - B/op
104
B/op104
B/op1
BenchmarkCachedRBACModelWithResourceRoles - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedRBACModelWithDomains
173.6
ns/op 120 B/op 4 allocs/opBenchmarkCachedRBACModelWithDomains - ns/op
173.6
ns/op167.2
ns/op1.04
BenchmarkCachedRBACModelWithDomains - B/op
120
B/op120
B/op1
BenchmarkCachedRBACModelWithDomains - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedABACModel
2871
ns/op 1538 B/op 18 allocs/opBenchmarkCachedABACModel - ns/op
2871
ns/op2836
ns/op1.01
BenchmarkCachedABACModel - B/op
1538
B/op1535
B/op1.00
BenchmarkCachedABACModel - allocs/op
18
allocs/op18
allocs/op1
BenchmarkCachedKeyMatchModel
180.4
ns/op 152 B/op 4 allocs/opBenchmarkCachedKeyMatchModel - ns/op
180.4
ns/op170.9
ns/op1.06
BenchmarkCachedKeyMatchModel - B/op
152
B/op152
B/op1
BenchmarkCachedKeyMatchModel - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedRBACModelWithDeny
164.6
ns/op 104 B/op 4 allocs/opBenchmarkCachedRBACModelWithDeny - ns/op
164.6
ns/op158.8
ns/op1.04
BenchmarkCachedRBACModelWithDeny - B/op
104
B/op104
B/op1
BenchmarkCachedRBACModelWithDeny - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedPriorityModel
170.5
ns/op 104 B/op 4 allocs/opBenchmarkCachedPriorityModel - ns/op
170.5
ns/op158.1
ns/op1.08
BenchmarkCachedPriorityModel - B/op
104
B/op104
B/op1
BenchmarkCachedPriorityModel - allocs/op
4
allocs/op4
allocs/op1
BenchmarkCachedWithEnforceContext
295.5
ns/op 240 B/op 5 allocs/opBenchmarkCachedWithEnforceContext - ns/op
295.5
ns/op288.9
ns/op1.02
BenchmarkCachedWithEnforceContext - B/op
240
B/op240
B/op1
BenchmarkCachedWithEnforceContext - allocs/op
5
allocs/op5
allocs/op1
BenchmarkCachedRBACModelMediumParallel
168.1
ns/op 106 B/op 4 allocs/opBenchmarkCachedRBACModelMediumParallel - ns/op
168.1
ns/op173.6
ns/op0.97
BenchmarkCachedRBACModelMediumParallel - B/op
106
B/op106
B/op1
BenchmarkCachedRBACModelMediumParallel - allocs/op
4
allocs/op4
allocs/op1
BenchmarkHasPolicySmall
462.4
ns/op 150 B/op 6 allocs/opBenchmarkHasPolicySmall - ns/op
462.4
ns/op437.7
ns/op1.06
BenchmarkHasPolicySmall - B/op
150
B/op150
B/op1
BenchmarkHasPolicySmall - allocs/op
6
allocs/op6
allocs/op1
BenchmarkHasPolicyMedium
486.9
ns/op 157 B/op 6 allocs/opBenchmarkHasPolicyMedium - ns/op
486.9
ns/op472.9
ns/op1.03
BenchmarkHasPolicyMedium - B/op
157
B/op157
B/op1
BenchmarkHasPolicyMedium - allocs/op
6
allocs/op6
allocs/op1
BenchmarkHasPolicyLarge
522.1
ns/op 165 B/op 7 allocs/opBenchmarkHasPolicyLarge - ns/op
522.1
ns/op518
ns/op1.01
BenchmarkHasPolicyLarge - B/op
165
B/op165
B/op1
BenchmarkHasPolicyLarge - allocs/op
7
allocs/op7
allocs/op1
BenchmarkAddPolicySmall
492.3
ns/op 152 B/op 6 allocs/opBenchmarkAddPolicySmall - ns/op
492.3
ns/op470
ns/op1.05
BenchmarkAddPolicySmall - B/op
152
B/op152
B/op1
BenchmarkAddPolicySmall - allocs/op
6
allocs/op6
allocs/op1
BenchmarkAddPolicyMedium
593.4
ns/op 172 B/op 7 allocs/opBenchmarkAddPolicyMedium - ns/op
593.4
ns/op552
ns/op1.07
BenchmarkAddPolicyMedium - B/op
172
B/op172
B/op1
BenchmarkAddPolicyMedium - allocs/op
7
allocs/op7
allocs/op1
BenchmarkAddPolicyLarge
1198
ns/op 473 B/op 9 allocs/opBenchmarkAddPolicyLarge - ns/op
1198
ns/op1153
ns/op1.04
BenchmarkAddPolicyLarge - B/op
473
B/op473
B/op1
BenchmarkAddPolicyLarge - allocs/op
9
allocs/op9
allocs/op1
BenchmarkRemovePolicySmall
461.1
ns/op 166 B/op 7 allocs/opBenchmarkRemovePolicySmall - ns/op
461.1
ns/op483.8
ns/op0.95
BenchmarkRemovePolicySmall - B/op
166
B/op166
B/op1
BenchmarkRemovePolicySmall - allocs/op
7
allocs/op7
allocs/op1
BenchmarkRemovePolicyMedium
539.9
ns/op 176 B/op 7 allocs/opBenchmarkRemovePolicyMedium - ns/op
539.9
ns/op547.2
ns/op0.99
BenchmarkRemovePolicyMedium - B/op
176
B/op176
B/op1
BenchmarkRemovePolicyMedium - allocs/op
7
allocs/op7
allocs/op1
BenchmarkRemovePolicyLarge
1206
ns/op 286 B/op 13 allocs/opBenchmarkRemovePolicyLarge - ns/op
1206
ns/op1212
ns/op1.00
BenchmarkRemovePolicyLarge - B/op
286
B/op292
B/op0.98
BenchmarkRemovePolicyLarge - allocs/op
13
allocs/op13
allocs/op1
BenchmarkRaw
17.58
ns/op 0 B/op 0 allocs/opBenchmarkRaw - ns/op
17.58
ns/op17.53
ns/op1.00
BenchmarkRaw - B/op
0
B/op0
B/op1
BenchmarkRaw - allocs/op
0
allocs/op0
allocs/op1
BenchmarkBasicModel
3647
ns/op 1508 B/op 17 allocs/opBenchmarkBasicModel - ns/op
3647
ns/op3742
ns/op0.97
BenchmarkBasicModel - B/op
1508
B/op1504
B/op1.00
BenchmarkBasicModel - allocs/op
17
allocs/op17
allocs/op1
BenchmarkRBACModel
5423
ns/op 2061 B/op 35 allocs/opBenchmarkRBACModel - ns/op
5423
ns/op5386
ns/op1.01
BenchmarkRBACModel - B/op
2061
B/op2057
B/op1.00
BenchmarkRBACModel - allocs/op
35
allocs/op35
allocs/op1
BenchmarkRBACModelSizes/small
48230
ns/op 20261 B/op 480 allocs/opBenchmarkRBACModelSizes/small - ns/op
48230
ns/op48505
ns/op0.99
BenchmarkRBACModelSizes/small - B/op
20261
B/op20297
B/op1.00
BenchmarkRBACModelSizes/small - allocs/op
480
allocs/op480
allocs/op1
BenchmarkRBACModelSizes/medium
516998
ns/op 191748 B/op 4827 allocs/opBenchmarkRBACModelSizes/medium - ns/op
516998
ns/op501473
ns/op1.03
BenchmarkRBACModelSizes/medium - B/op
191748
B/op191420
B/op1.00
BenchmarkRBACModelSizes/medium - allocs/op
4827
allocs/op4830
allocs/op1.00
BenchmarkRBACModelSizes/large
5336522
ns/op 1906072 B/op 48353 allocs/opBenchmarkRBACModelSizes/large - ns/op
5336522
ns/op5190166
ns/op1.03
BenchmarkRBACModelSizes/large - B/op
1906072
B/op1901599
B/op1.00
BenchmarkRBACModelSizes/large - allocs/op
48353
allocs/op48224
allocs/op1.00
BenchmarkRBACModelSmall
56481
ns/op 20362 B/op 615 allocs/opBenchmarkRBACModelSmall - ns/op
56481
ns/op58162
ns/op0.97
BenchmarkRBACModelSmall - B/op
20362
B/op20366
B/op1.00
BenchmarkRBACModelSmall - allocs/op
615
allocs/op615
allocs/op1
BenchmarkRBACModelMedium
565580
ns/op 194598 B/op 6020 allocs/opBenchmarkRBACModelMedium - ns/op
565580
ns/op582623
ns/op0.97
BenchmarkRBACModelMedium - B/op
194598
B/op194743
B/op1.00
BenchmarkRBACModelMedium - allocs/op
6020
allocs/op6021
allocs/op1.00
BenchmarkRBACModelLarge
5991834
ns/op 1940335 B/op 60599 allocs/opBenchmarkRBACModelLarge - ns/op
5991834
ns/op6170059
ns/op0.97
BenchmarkRBACModelLarge - B/op
1940335
B/op1941830
B/op1.00
BenchmarkRBACModelLarge - allocs/op
60599
allocs/op60649
allocs/op1.00
BenchmarkRBACModelWithResourceRoles
4539
ns/op 1843 B/op 27 allocs/opBenchmarkRBACModelWithResourceRoles - ns/op
4539
ns/op4531
ns/op1.00
BenchmarkRBACModelWithResourceRoles - B/op
1843
B/op1840
B/op1.00
BenchmarkRBACModelWithResourceRoles - allocs/op
27
allocs/op27
allocs/op1
BenchmarkRBACModelWithDomains
5093
ns/op 1827 B/op 25 allocs/opBenchmarkRBACModelWithDomains - ns/op
5093
ns/op5083
ns/op1.00
BenchmarkRBACModelWithDomains - B/op
1827
B/op1817
B/op1.01
BenchmarkRBACModelWithDomains - allocs/op
25
allocs/op25
allocs/op1
BenchmarkABACModel
2893
ns/op 1534 B/op 17 allocs/opBenchmarkABACModel - ns/op
2893
ns/op2772
ns/op1.04
BenchmarkABACModel - B/op
1534
B/op1529
B/op1.00
BenchmarkABACModel - allocs/op
17
allocs/op17
allocs/op1
BenchmarkABACRuleModel
4034367
ns/op 1326375 B/op 40092 allocs/opBenchmarkABACRuleModel - ns/op
4034367
ns/op3915413
ns/op1.03
BenchmarkABACRuleModel - B/op
1326375
B/op1324462
B/op1.00
BenchmarkABACRuleModel - allocs/op
40092
allocs/op40091
allocs/op1.00
BenchmarkKeyMatchModel
6192
ns/op 3058 B/op 37 allocs/opBenchmarkKeyMatchModel - ns/op
6192
ns/op6076
ns/op1.02
BenchmarkKeyMatchModel - B/op
3058
B/op3055
B/op1.00
BenchmarkKeyMatchModel - allocs/op
37
allocs/op37
allocs/op1
BenchmarkRBACModelWithDeny
6880
ns/op 2476 B/op 49 allocs/opBenchmarkRBACModelWithDeny - ns/op
6880
ns/op6911
ns/op1.00
BenchmarkRBACModelWithDeny - B/op
2476
B/op2469
B/op1.00
BenchmarkRBACModelWithDeny - allocs/op
49
allocs/op49
allocs/op1
BenchmarkPriorityModel
4246
ns/op 1761 B/op 22 allocs/opBenchmarkPriorityModel - ns/op
4246
ns/op4208
ns/op1.01
BenchmarkPriorityModel - B/op
1761
B/op1757
B/op1.00
BenchmarkPriorityModel - allocs/op
22
allocs/op22
allocs/op1
BenchmarkRBACModelWithDomainPatternLarge
24387
ns/op 16745 B/op 164 allocs/opBenchmarkRBACModelWithDomainPatternLarge - ns/op
24387
ns/op23776
ns/op1.03
BenchmarkRBACModelWithDomainPatternLarge - B/op
16745
B/op16737
B/op1.00
BenchmarkRBACModelWithDomainPatternLarge - allocs/op
164
allocs/op164
allocs/op1
BenchmarkRoleManagerSmall
70383
ns/op 11955 B/op 797 allocs/opBenchmarkRoleManagerSmall - ns/op
70383
ns/op70117
ns/op1.00
BenchmarkRoleManagerSmall - B/op
11955
B/op11955
B/op1
BenchmarkRoleManagerSmall - allocs/op
797
allocs/op797
allocs/op1
BenchmarkRoleManagerMedium
748653
ns/op 125915 B/op 8741 allocs/opBenchmarkRoleManagerMedium - ns/op
748653
ns/op739209
ns/op1.01
BenchmarkRoleManagerMedium - B/op
125915
B/op125914
B/op1.00
BenchmarkRoleManagerMedium - allocs/op
8741
allocs/op8741
allocs/op1
BenchmarkRoleManagerLarge
8191233
ns/op 1349922 B/op 89741 allocs/opBenchmarkRoleManagerLarge - ns/op
8191233
ns/op8325910
ns/op0.98
BenchmarkRoleManagerLarge - B/op
1349922
B/op1349922
B/op1
BenchmarkRoleManagerLarge - allocs/op
89741
allocs/op89741
allocs/op1
BenchmarkBuildRoleLinksWithPatternLarge
6188018487
ns/op 5346308392 B/op 60950166 allocs/opBenchmarkBuildRoleLinksWithPatternLarge - ns/op
6188018487
ns/op6208020408
ns/op1.00
BenchmarkBuildRoleLinksWithPatternLarge - B/op
5346308392
B/op5338626584
B/op1.00
BenchmarkBuildRoleLinksWithPatternLarge - allocs/op
60950166
allocs/op60948713
allocs/op1.00
BenchmarkBuildRoleLinksWithDomainPatternLarge
167324166
ns/op 141336646 B/op 1676529 allocs/opBenchmarkBuildRoleLinksWithDomainPatternLarge - ns/op
167324166
ns/op173437397
ns/op0.96
BenchmarkBuildRoleLinksWithDomainPatternLarge - B/op
141336646
B/op141442892
B/op1.00
BenchmarkBuildRoleLinksWithDomainPatternLarge - allocs/op
1676529
allocs/op1676552
allocs/op1.00
BenchmarkBuildRoleLinksWithPatternAndDomainPatternLarge
6322665690
ns/op 5485058616 B/op 62560942 allocs/opBenchmarkBuildRoleLinksWithPatternAndDomainPatternLarge - ns/op
6322665690
ns/op6578074404
ns/op0.96
BenchmarkBuildRoleLinksWithPatternAndDomainPatternLarge - B/op
5485058616
B/op5488807368
B/op1.00
BenchmarkBuildRoleLinksWithPatternAndDomainPatternLarge - allocs/op
62560942
allocs/op62562036
allocs/op1.00
BenchmarkHasLinkWithPatternLarge
10698
ns/op 7609 B/op 111 allocs/opBenchmarkHasLinkWithPatternLarge - ns/op
10698
ns/op10664
ns/op1.00
BenchmarkHasLinkWithPatternLarge - B/op
7609
B/op7611
B/op1.00
BenchmarkHasLinkWithPatternLarge - allocs/op
111
allocs/op111
allocs/op1
BenchmarkHasLinkWithDomainPatternLarge
497.3
ns/op 80 B/op 5 allocs/opBenchmarkHasLinkWithDomainPatternLarge - ns/op
497.3
ns/op496.2
ns/op1.00
BenchmarkHasLinkWithDomainPatternLarge - B/op
80
B/op80
B/op1
BenchmarkHasLinkWithDomainPatternLarge - allocs/op
5
allocs/op5
allocs/op1
BenchmarkHasLinkWithPatternAndDomainPatternLarge
10858
ns/op 7607 B/op 111 allocs/opBenchmarkHasLinkWithPatternAndDomainPatternLarge - ns/op
10858
ns/op10684
ns/op1.02
BenchmarkHasLinkWithPatternAndDomainPatternLarge - B/op
7607
B/op7615
B/op1.00
BenchmarkHasLinkWithPatternAndDomainPatternLarge - allocs/op
111
allocs/op111
allocs/op1
This comment was automatically generated by workflow using github-action-benchmark.