Skip to content

Commit 121dd15

Browse files
committed
add user agent in admin client to display console in audit logs
1 parent 649c3d7 commit 121dd15

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

api/client-admin.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"bytes"
2121
"context"
2222
"encoding/json"
23+
"github.com/minio/console/pkg"
2324
"io"
2425
"net"
2526
"net/http"
@@ -449,6 +450,7 @@ func NewMinioAdminClient(ctx context.Context, sessionClaims *models.Principal) (
449450
if err != nil {
450451
return nil, err
451452
}
453+
adminClient.SetAppInfo(globalAppName, pkg.Version)
452454
return adminClient, nil
453455
}
454456

@@ -464,6 +466,7 @@ func newAdminFromClaims(claims *models.Principal, clientIP string) (*madmin.Admi
464466
if err != nil {
465467
return nil, err
466468
}
469+
adminClient.SetAppInfo(globalAppName, pkg.Version)
467470
adminClient.SetCustomTransport(GetConsoleHTTPClient(getMinIOServer(), clientIP).Transport)
468471
return adminClient, nil
469472
}
@@ -477,7 +480,7 @@ func newAdminFromCreds(accessKey, secretKey, endpoint string, tlsEnabled bool) (
477480
if err != nil {
478481
return nil, err
479482
}
480-
483+
minioClient.SetAppInfo(globalAppName, pkg.Version)
481484
return minioClient, nil
482485
}
483486

0 commit comments

Comments
 (0)