Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package minio-client for openSUSE:Factory 
checked in at 2023-05-19 11:55:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/minio-client (Old)
 and      /work/SRC/openSUSE:Factory/.minio-client.new.1533 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "minio-client"

Fri May 19 11:55:49 2023 rev:32 rq:1087873 version:20230518T165900Z

Changes:
--------
--- /work/SRC/openSUSE:Factory/minio-client/minio-client.changes        
2023-05-08 17:24:24.976742166 +0200
+++ /work/SRC/openSUSE:Factory/.minio-client.new.1533/minio-client.changes      
2023-05-19 11:56:19.907541261 +0200
@@ -1,0 +2,14 @@
+Fri May 19 04:59:19 UTC 2023 - ka...@b1-systems.de
+
+- Update to version 20230518T165900Z:
+  * Deprecate older idp commands (#4572)
+  * Add name and description for service accounts (#4569)
+  * bug: panic on nil pointer dereference for "mc admin heal" when
+    disk i… (#4571)
+  * Load Subnet proxy and API key from the env if found (#4557)
+  * randomly generate AK and SK on mc client (#4565)
+  * info: Correctly show pool config with offline node(s) (#4567)
+  * Support setting subnet url via env var in dev mode (#4564)
+- BuildRequire go1.19
+
+-------------------------------------------------------------------

Old:
----
  mc-20230504T181016Z.obscpio

New:
----
  mc-20230518T165900Z.obscpio

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ minio-client.spec ++++++
--- /var/tmp/diff_new_pack.yhSI7J/_old  2023-05-19 11:56:21.443550042 +0200
+++ /var/tmp/diff_new_pack.yhSI7J/_new  2023-05-19 11:56:21.447550065 +0200
@@ -22,14 +22,14 @@
 %define binary_name minio-client
 
 Name:           minio-client
-Version:        20230504T181016Z
+Version:        20230518T165900Z
 Release:        0
 Summary:        Client for MinIO
 License:        AGPL-3.0-only
 URL:            https://github.com/minio/mc
 Source:         %{archive_name}-%{version}.tar.gz
 Source1:        vendor.tar.gz
-BuildRequires:  go >= 1.18
+BuildRequires:  go >= 1.19
 
 %description
 MinIO Client is a replacement for ls, cp, mkdir, diff and rsync commands for 
filesystems and object storage.

++++++ _service ++++++
--- /var/tmp/diff_new_pack.yhSI7J/_old  2023-05-19 11:56:21.479550248 +0200
+++ /var/tmp/diff_new_pack.yhSI7J/_new  2023-05-19 11:56:21.483550271 +0200
@@ -5,7 +5,7 @@
     <param name="exclude">.git</param>
     <param name="changesgenerate">enable</param>
     <param name="versionformat">@PARENT_TAG@</param>
-    <param name="revision">RELEASE.2023-05-04T18-10-16Z</param>
+    <param name="revision">RELEASE.2023-05-18T16-59-00Z</param>
     <param name="match-tag">RELEASE.*</param>
     <param 
name="versionrewrite-pattern">RELEASE\.(.*)-(.*)-(.*)-(.*)-(.*)</param>
     <param name="versionrewrite-replacement">\1\2\3\4\5</param>
@@ -19,7 +19,7 @@
     <param name="compression">gz</param>
   </service>
   <service name="go_modules" mode="disabled">
-    <param name="archive">mc-20230504T181016Z.obscpio</param>
+    <param name="archive">mc-20230518T165900Z.obscpio</param>
   </service>
 </services>
 

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.yhSI7J/_old  2023-05-19 11:56:21.507550408 +0200
+++ /var/tmp/diff_new_pack.yhSI7J/_new  2023-05-19 11:56:21.511550431 +0200
@@ -1,6 +1,6 @@
 <servicedata>
 <service name="tar_scm">
                 <param name="url">https://github.com/minio/mc</param>
-              <param 
name="changesrevision">5a0d5116f4936f25b7a1a67c8119cdcad6112cce</param></service></servicedata>
+              <param 
name="changesrevision">43745a9a597547f6bcd381b63b2e3c509d9c51ac</param></service></servicedata>
 (No newline at EOF)
 

++++++ mc-20230504T181016Z.obscpio -> mc-20230518T165900Z.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mc-20230504T181016Z/cmd/admin-heal.go 
new/mc-20230518T165900Z/cmd/admin-heal.go
--- old/mc-20230504T181016Z/cmd/admin-heal.go   2023-05-04 20:10:16.000000000 
+0200
+++ new/mc-20230518T165900Z/cmd/admin-heal.go   2023-05-18 18:59:00.000000000 
+0200
@@ -380,7 +380,7 @@
                                        stateText = 
console.Colorize("DiskFailed", d.State)
                                }
                                fmt.Fprintf(&msg, "  +  %s : %s\n", 
d.DrivePath, stateText)
-                               if d.Healing {
+                               if d.Healing && d.HealInfo != nil {
                                        now := time.Now().UTC()
                                        scanSpeed := float64(d.UsedSpace) / 
float64(now.Sub(d.HealInfo.Started))
                                        remainingTime := 
time.Duration(float64(setsStatus[setIndex{d.PoolIndex, 
d.SetIndex}].maxUsedSpace-d.UsedSpace) / scanSpeed)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mc-20230504T181016Z/cmd/admin-idp-info.go 
new/mc-20230518T165900Z/cmd/admin-idp-info.go
--- old/mc-20230504T181016Z/cmd/admin-idp-info.go       2023-05-04 
20:10:16.000000000 +0200
+++ new/mc-20230518T165900Z/cmd/admin-idp-info.go       2023-05-18 
18:59:00.000000000 +0200
@@ -19,7 +19,6 @@
 
 import (
        "github.com/minio/cli"
-       "github.com/minio/madmin-go/v2"
 )
 
 var adminIDPInfoCmd = cli.Command{
@@ -30,44 +29,13 @@
        OnUsageError: onUsageError,
        Hidden:       true,
        Flags:        globalFlags,
-       CustomHelpTemplate: `NAME:
-  {{.HelpName}} - {{.Usage}}
+       CustomHelpTemplate: `This command is DEPRECATED.
 
-USAGE:
-  {{.HelpName}} TARGET ID_TYPE [CFG_NAME]
-
-  ID_TYPE must be one of 'ldap' or 'openid'.
-
-  **DEPRECATED**: This command will be removed in a future version. Please use
-  "mc admin idp ldap|openid" instead.
-
-FLAGS:
-   {{range .VisibleFlags}}{{.}}
-  {{end}}
-EXAMPLES:
-  1. Show configuration info for default (un-named) openid configuration.
-     {{.Prompt}} {{.HelpName}} play/ openid
-  2. Show configuration info for openid configuration named "dex_test".
-     {{.Prompt}} {{.HelpName}} play/ openid dex_test
-  3. Show configuration info for ldap.
-     {{.Prompt}} {{.HelpName}} play/ ldap
+Please use "mc admin idp ldap|openid" instead.
 `,
 }
 
-func mainAdminIDPGet(ctx *cli.Context) error {
-       if len(ctx.Args()) < 2 || len(ctx.Args()) > 3 {
-               showCommandHelpAndExit(ctx, 1)
-       }
-
-       args := ctx.Args()
-       idpType := args.Get(1)
-       validateIDType(idpType)
-       isOpenID := idpType == madmin.OpenidIDPCfg
-
-       var cfgName string
-       if len(args) == 3 {
-               cfgName = args.Get(2)
-       }
-
-       return adminIDPInfo(ctx, isOpenID, cfgName)
+func mainAdminIDPGet(_ *cli.Context) error {
+       deprecatedError("mc admin idp ldap|openid")
+       return nil
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mc-20230504T181016Z/cmd/admin-idp-list.go 
new/mc-20230518T165900Z/cmd/admin-idp-list.go
--- old/mc-20230504T181016Z/cmd/admin-idp-list.go       2023-05-04 
20:10:16.000000000 +0200
+++ new/mc-20230518T165900Z/cmd/admin-idp-list.go       2023-05-18 
18:59:00.000000000 +0200
@@ -19,7 +19,6 @@
 
 import (
        "github.com/minio/cli"
-       "github.com/minio/madmin-go/v2"
 )
 
 var adminIDPLsCmd = cli.Command{
@@ -31,39 +30,13 @@
        OnUsageError: onUsageError,
        Hidden:       true,
        Flags:        globalFlags,
-       CustomHelpTemplate: `NAME:
-  {{.HelpName}} - {{.Usage}}
+       CustomHelpTemplate: `This command is DEPRECATED.
 
-USAGE:
-  {{.HelpName}} TARGET ID_TYPE
-
-  **DEPRECATED**: This command will be removed in a future version. Please use
-  "mc admin idp ldap|openid" instead.
-
-FLAGS:
-  {{range .VisibleFlags}}{{.}}
-  {{end}}
-EXAMPLES:
-  1. List the available openid configurations.
-     {{.Prompt}} {{.HelpName}} play/ openid
-  2. List the available ldap configurations.
-     {{.Prompt}} {{.HelpName}} play/ ldap
+Please use  "mc admin idp ldap|openid" instead.
 `,
 }
 
-func mainAdminIDPList(ctx *cli.Context) error {
-       if len(ctx.Args()) != 2 {
-               showCommandHelpAndExit(ctx, 1)
-       }
-
-       args := ctx.Args()
-       idpType := args.Get(1)
-       validateIDType(idpType)
-
-       isOpenID := false
-       if idpType == madmin.OpenidIDPCfg {
-               isOpenID = true
-       }
-
-       return adminIDPListCommon(ctx, isOpenID)
+func mainAdminIDPList(_ *cli.Context) error {
+       deprecatedError("mc admin idp ldap|openid")
+       return nil
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mc-20230504T181016Z/cmd/admin-idp-remove.go 
new/mc-20230518T165900Z/cmd/admin-idp-remove.go
--- old/mc-20230504T181016Z/cmd/admin-idp-remove.go     2023-05-04 
20:10:16.000000000 +0200
+++ new/mc-20230518T165900Z/cmd/admin-idp-remove.go     2023-05-18 
18:59:00.000000000 +0200
@@ -19,7 +19,6 @@
 
 import (
        "github.com/minio/cli"
-       "github.com/minio/madmin-go/v2"
 )
 
 var adminIDPRmCmd = cli.Command{
@@ -31,35 +30,13 @@
        Hidden:       true,
        OnUsageError: onUsageError,
        Flags:        globalFlags,
-       CustomHelpTemplate: `NAME:
-  {{.HelpName}} - {{.Usage}}
+       CustomHelpTemplate: `This command is DEPRECATED.
 
-USAGE:
-  {{.HelpName}} TARGET IDP_TYPE CFG_NAME
-
-  **DEPRECATED**: This command will be removed in a future version. Please use
-  "mc admin idp ldap|openid" instead.
-
-FLAGS:
-  {{range .VisibleFlags}}{{.}}
-  {{end}}
-EXAMPLES:
-  1. Remove an OpenID configuration from the server.
-     {{.Prompt}} {{.HelpName}} play/ openid myidp
-  2. Remove default LDAP configuration from the server.
-     {{.Prompt}} {{.HelpName}} play/ ldap _
+Please use "mc admin idp ldap|openid" instead.
 `,
 }
 
-func mainAdminIDPRemove(ctx *cli.Context) error {
-       if len(ctx.Args()) != 3 {
-               showCommandHelpAndExit(ctx, 1)
-       }
-
-       args := ctx.Args()
-       idpType := args.Get(1)
-       validateIDType(idpType)
-
-       cfgName := args.Get(2)
-       return adminIDPRemove(ctx, idpType == madmin.OpenidIDPCfg, cfgName)
+func mainAdminIDPRemove(_ *cli.Context) error {
+       deprecatedError("mc admin idp ldap|openid")
+       return nil
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mc-20230504T181016Z/cmd/admin-idp-set.go 
new/mc-20230518T165900Z/cmd/admin-idp-set.go
--- old/mc-20230504T181016Z/cmd/admin-idp-set.go        2023-05-04 
20:10:16.000000000 +0200
+++ new/mc-20230518T165900Z/cmd/admin-idp-set.go        2023-05-18 
18:59:00.000000000 +0200
@@ -18,13 +18,7 @@
 package cmd
 
 import (
-       "errors"
-       "fmt"
-       "strings"
-
        "github.com/minio/cli"
-       "github.com/minio/madmin-go/v2"
-       "github.com/minio/mc/pkg/probe"
 )
 
 var adminIDPSetCmd = cli.Command{
@@ -35,90 +29,13 @@
        Hidden:       true,
        OnUsageError: onUsageError,
        Flags:        globalFlags,
-       CustomHelpTemplate: `NAME:
-  {{.HelpName}} - {{.Usage}}
-
-USAGE:
-  {{.HelpName}} TARGET ID_TYPE [CFG_NAME] [CFG_PARAMS...]
-
-  ID_TYPE must be one of 'ldap' or 'openid'.
-
-  **DEPRECATED**: This command will be removed in a future version. Please use
-  "mc admin idp ldap|openid" instead.
-
-FLAGS:
-  {{range .VisibleFlags}}{{.}}
-  {{end}}
-EXAMPLES:
-  1. Create/Update the default OpenID IDP configuration (CFG_NAME is omitted).
-     {{.Prompt}} {{.HelpName}} play/ openid \
-          client_id=minio-client-app \
-          client_secret=minio-client-app-secret \
-          
config_url="http://localhost:5556/dex/.well-known/openid-configuration"; \
-          scopes="openid,groups" \
-          redirect_uri="http://127.0.0.1:10000/oauth_callback"; \
-          role_policy="consoleAdmin"
-  2. Create/Update configuration for OpenID IDP configuration named "dex_test".
-     {{.Prompt}} {{.HelpName}} play/ openid dex_test \
-          client_id=minio-client-app \
-          client_secret=minio-client-app-secret \
-          
config_url="http://localhost:5556/dex/.well-known/openid-configuration"; \
-          scopes="openid,groups" \
-          redirect_uri="http://127.0.0.1:10000/oauth_callback"; \
-          role_policy="consoleAdmin"
-  3. Create/Update the LDAP IDP configuration (CFG_NAME must be empty for 
LDAP).
-     {{.Prompt}} {{.HelpName}} play/ ldap \
-          server_addr=ldap.corp.min.io:686 \
-          lookup_bind_dn=cn=readonly,ou=service_account,dc=min,dc=io \
-          lookup_bind_password=mysecretpassword \
-          user_dn_search_base_dn=dc=min,dc=io \
-          user_dn_search_filter="(uid=%s)" \
-          group_search_base_dn=ou=swengg,dc=min,dc=io \
-          group_search_filter="(&(objectclass=groupofnames)(member=%d))"
+       CustomHelpTemplate: `This command is DEPRECATED.
 
+Please use commands under 'mc admin idp ldap|openid' instead.
 `,
 }
 
-func validateIDType(idpType string) {
-       if !madmin.ValidIDPConfigTypes.Contains(idpType) {
-               fatalIf(probe.NewError(errors.New("invalid IDP type")),
-                       fmt.Sprintf("IDP type must be one of %v", 
madmin.ValidIDPConfigTypes))
-       }
-}
-
-func mainAdminIDPSet(ctx *cli.Context) error {
-       if len(ctx.Args()) < 3 {
-               showCommandHelpAndExit(ctx, 1)
-       }
-
-       args := ctx.Args()
-
-       aliasedURL := args.Get(0)
-
-       // Create a new MinIO Admin Client
-       client, err := newAdminClient(aliasedURL)
-       fatalIf(err, "Unable to initialize admin connection.")
-
-       idpType := args.Get(1)
-       validateIDType(idpType)
-
-       var cfgName string
-       input := args[2:]
-       if !strings.Contains(args.Get(2), "=") {
-               cfgName = args.Get(2)
-               input = args[3:]
-       }
-
-       inputCfg := strings.Join(input, " ")
-
-       restart, e := client.AddOrUpdateIDPConfig(globalContext, idpType, 
cfgName, inputCfg, false)
-       fatalIf(probe.NewError(e), "Unable to set IDP config for '%s' to 
server", idpType)
-
-       // Print set config result
-       printMsg(configSetMessage{
-               targetAlias: aliasedURL,
-               restart:     restart,
-       })
-
+func mainAdminIDPSet(_ *cli.Context) error {
+       deprecatedError("mc admin idp ldap|openid")
        return nil
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mc-20230504T181016Z/cmd/admin-info.go 
new/mc-20230518T165900Z/cmd/admin-info.go
--- old/mc-20230504T181016Z/cmd/admin-info.go   2023-05-04 20:10:16.000000000 
+0200
+++ new/mc-20230518T165900Z/cmd/admin-info.go   2023-05-18 18:59:00.000000000 
+0200
@@ -59,6 +59,7 @@
 }
 
 type poolSummary struct {
+       index          int
        setsCount      int
        drivesPerSet   int
        driveTolerance int
@@ -75,26 +76,29 @@
                        pool := summary[disk.PoolIndex]
                        if pool == nil {
                                pool = &poolSummary{
+                                       index:          disk.PoolIndex,
                                        endpoints:      set.NewStringSet(),
                                        driveTolerance: info.StandardParity(),
                                }
                        }
-                       pool.endpoints.Add(srv.Endpoint)
-                       if disk.SetIndex > pool.setsCount {
-                               pool.setsCount = disk.SetIndex
-                       }
-                       if disk.DiskIndex > pool.drivesPerSet {
-                               pool.drivesPerSet = disk.DiskIndex
+                       // Deprecated calculation based on disk location
+                       if disk.SetIndex+1 > pool.setsCount {
+                               pool.setsCount = disk.SetIndex + 1
+                       }
+                       // Deprecated calculation based on disk location
+                       if disk.DiskIndex+1 > pool.drivesPerSet {
+                               pool.drivesPerSet = disk.DiskIndex + 1
                        }
-
+                       pool.endpoints.Add(srv.Endpoint)
                        summary[disk.PoolIndex] = pool
                }
        }
-       // We calculated max set index and max disk index
-       // increase by one to show the number of sets and drives
-       for _, pool := range summary {
-               pool.setsCount++
-               pool.drivesPerSet++
+
+       if len(info.Backend.TotalSets) > 0 { // Check if this is a recent 
enough MinIO version
+               for _, pool := range summary {
+                       pool.setsCount = info.Backend.TotalSets[pool.index]
+                       pool.drivesPerSet = 
info.Backend.DrivesPerSet[pool.index]
+               }
        }
        return summary
 }
@@ -144,8 +148,6 @@
 
        // Initialization
        var totalOfflineNodes int
-       var totalOnlineDrivesCluster int
-       var totalOfflineDrivesCluster int
 
        // Color palette initialization
        console.SetColor("Info", color.New(color.FgGreen, color.Bold))
@@ -189,8 +191,6 @@
                                }
 
                                totalDrivesPerServer := OnDrives + OffDrives
-                               totalOnlineDrivesCluster += OnDrives
-                               totalOfflineDrivesCluster += OffDrives
 
                                dispNoOfDrives = strconv.Itoa(OnDrives) + "/" + 
strconv.Itoa(totalDrivesPerServer)
                                msg += fmt.Sprintf("   Drives: %s %s\n", 
dispNoOfDrives, console.Colorize("InfoFail", "OK "))
@@ -247,8 +247,6 @@
                        }
 
                        totalDrivesPerServer := OnDrives + OffDrives
-                       totalOnlineDrivesCluster += OnDrives
-                       totalOfflineDrivesCluster += OffDrives
                        clr := "Info"
                        if OnDrives != totalDrivesPerServer {
                                clr = "InfoWarning"
@@ -295,16 +293,9 @@
                }
                // Summary on total no of online and total
                // number of offline drives at the Cluster level
-               bkInfo, ok := u.Info.Backend.(madmin.ErasureBackend)
-               if ok {
-                       msg += fmt.Sprintf("%s online, %s offline\n",
-                               english.Plural(bkInfo.OnlineDisks, "drive", ""),
-                               english.Plural(bkInfo.OfflineDisks, "drive", 
""))
-               } else {
-                       msg += fmt.Sprintf("%s online, %s offline\n",
-                               english.Plural(totalOnlineDrivesCluster, 
"drive", ""),
-                               english.Plural(totalOfflineDrivesCluster, 
"drive", ""))
-               }
+               msg += fmt.Sprintf("%s online, %s offline\n",
+                       english.Plural(u.Info.Backend.OnlineDisks, "drive", ""),
+                       english.Plural(u.Info.Backend.OfflineDisks, "drive", 
""))
        }
 
        // Remove the last new line if any
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mc-20230504T181016Z/cmd/admin-user-svcacct-add.go 
new/mc-20230518T165900Z/cmd/admin-user-svcacct-add.go
--- old/mc-20230504T181016Z/cmd/admin-user-svcacct-add.go       2023-05-04 
20:10:16.000000000 +0200
+++ new/mc-20230518T165900Z/cmd/admin-user-svcacct-add.go       2023-05-18 
18:59:00.000000000 +0200
@@ -19,6 +19,8 @@
 
 import (
        "bytes"
+       "crypto/rand"
+       "encoding/base64"
        "fmt"
        "os"
        "strings"
@@ -48,8 +50,17 @@
                Usage: "path to a JSON policy file",
        },
        cli.StringFlag{
-               Name:  "comment",
-               Usage: "personal note for the service account",
+               Name:  "name",
+               Usage: "friendly name for the service account",
+       },
+       cli.StringFlag{
+               Name:  "description",
+               Usage: "description for the service account",
+       },
+       cli.StringFlag{
+               Name:   "comment",
+               Hidden: true,
+               Usage:  "description for the service account (DEPRECATED: use 
--description instead)",
        },
 }
 
@@ -67,14 +78,20 @@
   {{.HelpName}} ALIAS ACCOUNT
 
 ACCOUNT:
-  An account could be a regular MinIO user, STS ou LDAP user.
+  An account could be a regular MinIO user, STS or LDAP user.
 
 FLAGS:
   {{range .VisibleFlags}}{{.}}
   {{end}}
 EXAMPLES:
-  1. Add a new service account for user 'foobar' to MinIO server.
-     {{.Prompt}} {{.HelpName}} myminio foobar
+  1. Add a new service account for user 'foobar' to MinIO server with a name 
and description.
+     {{.Prompt}} {{.HelpName}} myminio foobar --name uploaderKey --description 
"foobar uploader scripts"
+  2. Add a new service account to MinIO server with specified access key and 
secret key for user'foobar'.
+     {{.Prompt}} {{.HelpName}} myminio foobar --access-key "myaccesskey" 
--secret-key "mysecretkey"
+  3. Add a new service account to MinIO server with specified access key and 
random secret key for user'foobar'.
+     {{.Prompt}} {{.HelpName}} myminio foobar --access-key "myaccesskey"
+  4. Add a new service account to MinIO server with specified secret key and 
random access key for user'foobar'.
+     {{.Prompt}} {{.HelpName}} myminio foobar --secret-key "mysecretkey"
 `,
 }
 
@@ -94,7 +111,8 @@
        ParentUser    string          `json:"parentUser,omitempty"`
        ImpliedPolicy bool            `json:"impliedPolicy,omitempty"`
        Policy        json.RawMessage `json:"policy,omitempty"`
-       Comment       string          `json:"comment,omitempty"`
+       Name          string          `json:"name,omitempty"`
+       Description   string          `json:"description,omitempty"`
        AccountStatus string          `json:"accountStatus,omitempty"`
        MemberOf      []string        `json:"memberOf,omitempty"`
        Expiration    *time.Time      `json:"expiration,omitempty"`
@@ -116,6 +134,21 @@
        svcAccOpSet
 
        stsAccOpInfo
+
+       // Maximum length for MinIO access key.
+       // There is no max length enforcement for access keys
+       accessKeyMaxLen = 20
+
+       // Alpha numeric table used for generating access keys.
+       alphaNumericTable = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+
+       // Total length of the alpha numeric table.
+       alphaNumericTableLen = byte(len(alphaNumericTable))
+
+       // Maximum secret key length for MinIO, this
+       // is used when autogenerating new credentials.
+       // There is no max length enforcement for secret keys
+       secretKeyMaxLen = 40
 )
 
 func (u acctMessage) String() string {
@@ -137,7 +170,8 @@
                                fmt.Sprintf("AccessKey: %s", u.AccessKey),
                                fmt.Sprintf("ParentUser: %s", u.ParentUser),
                                fmt.Sprintf("Status: %s", u.AccountStatus),
-                               fmt.Sprintf("Comment: %s", u.Comment),
+                               fmt.Sprintf("Name: %s", u.Name),
+                               fmt.Sprintf("Description: %s", u.Description),
                                fmt.Sprintf("Policy: %s", policyField),
                                func() string {
                                        if u.Expiration != nil {
@@ -161,6 +195,42 @@
        return ""
 }
 
+// generateCredentials - creates randomly generated credentials of maximum
+// allowed length.
+func generateCredentials() (accessKey, secretKey string, err error) {
+       readBytes := func(size int) (data []byte, err error) {
+               data = make([]byte, size)
+               var n int
+               if n, err = rand.Read(data); err != nil {
+                       return nil, err
+               } else if n != size {
+                       return nil, fmt.Errorf("Not enough data. Expected to 
read: %v bytes, got: %v bytes", size, n)
+               }
+               return data, nil
+       }
+
+       // Generate access key.
+       keyBytes, err := readBytes(accessKeyMaxLen)
+       if err != nil {
+               return "", "", err
+       }
+       for i := 0; i < accessKeyMaxLen; i++ {
+               keyBytes[i] = 
alphaNumericTable[keyBytes[i]%alphaNumericTableLen]
+       }
+       accessKey = string(keyBytes)
+
+       // Generate secret key.
+       keyBytes, err = readBytes(secretKeyMaxLen)
+       if err != nil {
+               return "", "", err
+       }
+
+       secretKey = 
strings.ReplaceAll(string([]byte(base64.StdEncoding.EncodeToString(keyBytes))[:secretKeyMaxLen]),
+               "/", "+")
+
+       return accessKey, secretKey, nil
+}
+
 func (u acctMessage) JSON() string {
        u.Status = "success"
        jsonMessageBytes, e := json.MarshalIndent(u, "", " ")
@@ -183,7 +253,25 @@
        accessKey := ctx.String("access-key")
        secretKey := ctx.String("secret-key")
        policyPath := ctx.String("policy")
-       comment := ctx.String("comment")
+       name := ctx.String("name")
+       description := ctx.String("description")
+       if description == "" {
+               description = ctx.String("comment")
+       }
+
+       // generate access key and secret key
+       if len(accessKey) <= 0 || len(secretKey) <= 0 {
+               randomAccessKey, randomSecretKey, err := generateCredentials()
+               if err != nil {
+                       fatalIf(probe.NewError(err), "Unable to add a new 
service account")
+               }
+               if len(accessKey) <= 0 {
+                       accessKey = randomAccessKey
+               }
+               if len(secretKey) <= 0 {
+                       secretKey = randomSecretKey
+               }
+       }
 
        // Create a new MinIO Admin Client
        client, err := newAdminClient(aliasedURL)
@@ -203,11 +291,12 @@
        }
 
        opts := madmin.AddServiceAccountReq{
-               Policy:     policyBytes,
-               AccessKey:  accessKey,
-               SecretKey:  secretKey,
-               Comment:    comment,
-               TargetUser: user,
+               Policy:      policyBytes,
+               AccessKey:   accessKey,
+               SecretKey:   secretKey,
+               Name:        name,
+               Description: description,
+               TargetUser:  user,
        }
 
        creds, e := client.AddServiceAccount(globalContext, opts)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mc-20230504T181016Z/cmd/admin-user-svcacct-info.go 
new/mc-20230518T165900Z/cmd/admin-user-svcacct-info.go
--- old/mc-20230504T181016Z/cmd/admin-user-svcacct-info.go      2023-05-04 
20:10:16.000000000 +0200
+++ new/mc-20230518T165900Z/cmd/admin-user-svcacct-info.go      2023-05-18 
18:59:00.000000000 +0200
@@ -98,7 +98,8 @@
        printMsg(acctMessage{
                op:            svcAccOpInfo,
                AccessKey:     svcAccount,
-               Comment:       svcInfo.Comment,
+               Name:          svcInfo.Name,
+               Description:   svcInfo.Description,
                AccountStatus: svcInfo.AccountStatus,
                ParentUser:    svcInfo.ParentUser,
                ImpliedPolicy: svcInfo.ImpliedPolicy,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mc-20230504T181016Z/cmd/admin-user-svcacct-set.go 
new/mc-20230518T165900Z/cmd/admin-user-svcacct-set.go
--- old/mc-20230504T181016Z/cmd/admin-user-svcacct-set.go       2023-05-04 
20:10:16.000000000 +0200
+++ new/mc-20230518T165900Z/cmd/admin-user-svcacct-set.go       2023-05-18 
18:59:00.000000000 +0200
@@ -35,8 +35,12 @@
                Usage: "path to a JSON policy file",
        },
        cli.StringFlag{
-               Name:  "comment",
-               Usage: "personal note for the service account",
+               Name:  "name",
+               Usage: "name for the service account",
+       },
+       cli.StringFlag{
+               Name:  "description",
+               Usage: "description for the service account",
        },
 }
 
@@ -81,7 +85,8 @@
 
        secretKey := ctx.String("secret-key")
        policyPath := ctx.String("policy")
-       comment := ctx.String("comment")
+       name := ctx.String("name")
+       description := ctx.String("description")
 
        // Create a new MinIO Admin Client
        client, err := newAdminClient(aliasedURL)
@@ -95,9 +100,10 @@
        }
 
        opts := madmin.UpdateServiceAccountReq{
-               NewPolicy:    buf,
-               NewSecretKey: secretKey,
-               NewComment:   comment,
+               NewPolicy:      buf,
+               NewSecretKey:   secretKey,
+               NewName:        name,
+               NewDescription: description,
        }
 
        e := client.UpdateServiceAccount(globalContext, svcAccount, opts)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mc-20230504T181016Z/cmd/subnet-utils.go 
new/mc-20230518T165900Z/cmd/subnet-utils.go
--- old/mc-20230504T181016Z/cmd/subnet-utils.go 2023-05-04 20:10:16.000000000 
+0200
+++ new/mc-20230518T165900Z/cmd/subnet-utils.go 2023-05-18 18:59:00.000000000 
+0200
@@ -66,8 +66,9 @@
                        Usage: "use in environments without network access to 
SUBNET (e.g. airgapped, firewalled, etc.)",
                },
                cli.StringFlag{
-                       Name:  "api-key",
-                       Usage: "API Key of the account on SUBNET",
+                       Name:   "api-key",
+                       Usage:  "API Key of the account on SUBNET",
+                       EnvVar: "_MC_SUBNET_API_KEY",
                },
        }
 )
@@ -81,6 +82,10 @@
 
 func subnetBaseURL() string {
        if globalDevMode {
+               subnetURLDev := os.Getenv("SUBNET_URL_DEV")
+               if len(subnetURLDev) > 0 {
+                       return subnetURLDev
+               }
                return "http://localhost:9000";
        }
 
@@ -211,7 +216,7 @@
        if resp.StatusCode == http.StatusOK {
                return respStr, nil
        }
-       return respStr, fmt.Errorf("Request failed with code %d and error: %s", 
resp.StatusCode, respStr)
+       return respStr, fmt.Errorf("Request failed with code %d with error: 
%s", resp.StatusCode, respStr)
 }
 
 func subnetGetReq(reqURL string, headers map[string]string) (string, error) {
@@ -289,8 +294,19 @@
                return nil
        }
 
+       var (
+               proxy     string
+               supported bool
+       )
+
+       if env, ok := os.LookupEnv("_MC_SUBNET_PROXY_URL"); ok {
+               proxy = env
+               supported = env != ""
+       } else {
+               proxy, supported = getKeyFromSubnetConfig(alias, "proxy")
+       }
+
        // get the subnet proxy config from MinIO if available
-       proxy, supported := getKeyFromSubnetConfig(alias, "proxy")
        if supported && len(proxy) > 0 {
                proxyURL, e := url.Parse(proxy)
                if e != nil {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mc-20230504T181016Z/cmd/support-profile.go 
new/mc-20230518T165900Z/cmd/support-profile.go
--- old/mc-20230504T181016Z/cmd/support-profile.go      2023-05-04 
20:10:16.000000000 +0200
+++ new/mc-20230518T165900Z/cmd/support-profile.go      2023-05-18 
18:59:00.000000000 +0200
@@ -208,8 +208,8 @@
        if !globalAirgapped {
                _, e := uploadFileToSubnet(alias, profileFile, reqURL, headers)
                if e != nil {
-                       failureClr.Println("\nUnable to upload profile file to 
SUBNET.", e.Error())
-                       successClr.Printf("It has been saved locally at 
'%s'\n", profileFile)
+                       failureClr.Println("\nUnable to upload profile file to 
SUBNET:", e.Error())
+                       successClr.Printf("Profiling data are saved locally at 
'%s'\n", profileFile)
                        return
                }
                successClr.Println("uploaded successfully to SUBNET.")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mc-20230504T181016Z/go.mod 
new/mc-20230518T165900Z/go.mod
--- old/mc-20230504T181016Z/go.mod      2023-05-04 20:10:16.000000000 +0200
+++ new/mc-20230518T165900Z/go.mod      2023-05-18 18:59:00.000000000 +0200
@@ -19,7 +19,7 @@
        github.com/minio/cli v1.24.2
        github.com/minio/colorjson v1.0.4
        github.com/minio/filepath v1.0.0
-       github.com/minio/madmin-go/v2 v2.0.19
+       github.com/minio/madmin-go/v2 v2.1.3
        github.com/minio/md5-simd v1.1.2 // indirect
        github.com/minio/minio-go/v7 v7.0.52
        github.com/minio/pkg v1.6.5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mc-20230504T181016Z/go.sum 
new/mc-20230518T165900Z/go.sum
--- old/mc-20230504T181016Z/go.sum      2023-05-04 20:10:16.000000000 +0200
+++ new/mc-20230518T165900Z/go.sum      2023-05-18 18:59:00.000000000 +0200
@@ -518,8 +518,8 @@
 github.com/minio/filepath v1.0.0 
h1:fvkJu1+6X+ECRA6G3+JJETj4QeAYO9sV43I79H8ubDY=
 github.com/minio/filepath v1.0.0/go.mod 
h1:/nRZA2ldl5z6jT9/KQuvZcQlxZIMQoFFQPvEXx9T/Bw=
 github.com/minio/madmin-go v1.6.6/go.mod 
h1:ATvkBOLiP3av4D++2v1UEHC/QzsGtgXD5kYvvRYzdKs=
-github.com/minio/madmin-go/v2 v2.0.19 
h1:XznxdMVCTyr0A88JrZFhdxWY8KLfJcrs0TTmFiE9cc8=
-github.com/minio/madmin-go/v2 v2.0.19/go.mod 
h1:8bL1RMNkblIENFSgGYjeHrzUx9PxROb7OqfNuMU9ivE=
+github.com/minio/madmin-go/v2 v2.1.3 
h1:9pkUgAujfm/SaFei4a1LwpS2et1/qGvRjFqFbRWa6xA=
+github.com/minio/madmin-go/v2 v2.1.3/go.mod 
h1:8bL1RMNkblIENFSgGYjeHrzUx9PxROb7OqfNuMU9ivE=
 github.com/minio/md5-simd v1.1.2 
h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
 github.com/minio/md5-simd v1.1.2/go.mod 
h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
 github.com/minio/minio-go/v7 v7.0.41/go.mod 
h1:nCrRzjoSUQh8hgKKtu3Y708OLvRLtuASMg2/nvmbarw=

++++++ mc.obsinfo ++++++
--- /var/tmp/diff_new_pack.yhSI7J/_old  2023-05-19 11:56:21.795552055 +0200
+++ /var/tmp/diff_new_pack.yhSI7J/_new  2023-05-19 11:56:21.799552078 +0200
@@ -1,5 +1,5 @@
 name: mc
-version: 20230504T181016Z
-mtime: 1683223816
-commit: 5a0d5116f4936f25b7a1a67c8119cdcad6112cce
+version: 20230518T165900Z
+mtime: 1684429140
+commit: 43745a9a597547f6bcd381b63b2e3c509d9c51ac
 

++++++ vendor.tar.gz ++++++
/work/SRC/openSUSE:Factory/minio-client/vendor.tar.gz 
/work/SRC/openSUSE:Factory/.minio-client.new.1533/vendor.tar.gz differ: char 5, 
line 1

Reply via email to