Skip to content

Commit

Permalink
add user agent in admin client to display console in audit logs (mini…
Browse files Browse the repository at this point in the history
  • Loading branch information
prakashsvmx authored Apr 17, 2024
1 parent 649c3d7 commit 6cfb6ff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/client-admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import (
"strings"
"time"

"github.com/minio/console/pkg"

"github.com/minio/console/pkg/utils"

"github.com/minio/console/models"
Expand Down Expand Up @@ -449,6 +451,7 @@ func NewMinioAdminClient(ctx context.Context, sessionClaims *models.Principal) (
if err != nil {
return nil, err
}
adminClient.SetAppInfo(globalAppName, pkg.Version)
return adminClient, nil
}

Expand All @@ -464,6 +467,7 @@ func newAdminFromClaims(claims *models.Principal, clientIP string) (*madmin.Admi
if err != nil {
return nil, err
}
adminClient.SetAppInfo(globalAppName, pkg.Version)
adminClient.SetCustomTransport(GetConsoleHTTPClient(getMinIOServer(), clientIP).Transport)
return adminClient, nil
}
Expand All @@ -477,7 +481,7 @@ func newAdminFromCreds(accessKey, secretKey, endpoint string, tlsEnabled bool) (
if err != nil {
return nil, err
}

minioClient.SetAppInfo(globalAppName, pkg.Version)
return minioClient, nil
}

Expand Down

0 comments on commit 6cfb6ff

Please sign in to comment.