[#321] Use correct owner id in billing metrics #322
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-s3-gw#322
Loading…
Reference in a new issue
No description provided.
Delete branch "mbiryukova/frostfs-s3-gw:bugfix/anon_user_in_metrics"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #321
Can we add some tests? (see tests where middlewares are invoked https://git.frostfs.info/TrueCloudLab/frostfs-s3-gw/src/branch/master/api/router_test.go)
3137a70e92
to42b1014308
42b1014308
toe268ae19f8
Please, update CHANGELOG.md
@ -16,1 +29,4 @@
}
type centerMock struct {
t *testing.T
Let's add flag that determine anon/not anon behavior. Also this flag should be available from test to have opportunity toggle behavior with the same router.
in
TestOwnerIDRetrieving
we can toggle behavior usingchiRouter.cfg.Center.(*centerMock).anon = true
@ -39,0 +65,4 @@
type frostFSIDMock struct {
}
func (f *frostFSIDMock) ValidatePublicKey(_ *keys.PublicKey) error {
We can write just
func (f *frostFSIDMock) ValidatePublicKey(*keys.PublicKey) error {
(the same forGetUserGroupID
)@ -253,6 +254,26 @@ func TestDefaultBehaviorPolicyChecker(t *testing.T) {
assertAPIError(t, w, apiErrors.ErrAccessDenied)
}
func TestOwnerIDRetrieving(t *testing.T) {
This is great test, but can we add another one that check metrics?
For example, we can check if metics contains valid data
chiRouter.cfg.Metrics.UsersAPIStats().DumpMetrics()
But for this we need make change in
AppMetrics
This is ok for
master
I suppose, but forsupport
probably we should keep as little changes as possible.cc @alexvanin
e268ae19f8
to659e7dbf89
@ -256,0 +284,4 @@
require.Equal(t, "anon", resp.ReqInfo.User)
}
func TestDumpMetrics(t *testing.T) {
Can we rename this to not be confused with test that dumps (prints) all supported metrics (test
TestDescribeAll
with tagdump_metrics
)?659e7dbf89
to2981a47e99