Skip to content

Commit 41be5f1

Browse files
authored
Merge branch 'master' into ldap-enable-glitch
2 parents bbbc24c + b1a3941 commit 41be5f1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+7604
-4658
lines changed

.github/workflows/go-cross.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ${{ matrix.os }}
2121
strategy:
2222
matrix:
23-
go-version: [1.22.x]
23+
go-version: [1.23.x]
2424
os: [ubuntu-latest]
2525
steps:
2626
- uses: actions/checkout@v4

.github/workflows/go.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
GO111MODULE: on
2020
strategy:
2121
matrix:
22-
go-version: [1.22.x]
22+
go-version: [1.23.x]
2323
os: [ubuntu-latest, macos-latest, windows-latest]
2424
steps:
2525
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -69,7 +69,7 @@ jobs:
6969
- name: Set up Go
7070
uses: actions/setup-go@v2
7171
with:
72-
go-version: 1.22.x
72+
go-version: 1.23.x
7373

7474
- name: Checkout code
7575
uses: actions/checkout@v2

.github/workflows/vulncheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Go
1717
uses: actions/setup-go@v5
1818
with:
19-
go-version: 1.22.5
19+
go-version: 1.23.4
2020
- name: Get official govulncheck
2121
run: go install golang.org/x/vuln/cmd/govulncheck@latest
2222
shell: bash

CREDITS

Lines changed: 5682 additions & 4235 deletions
Large diffs are not rendered by default.

cmd/admin-accesskey-create.go

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
// Copyright (c) 2015-2024 MinIO, Inc.
2+
//
3+
// This file is part of MinIO Object Storage stack
4+
//
5+
// This program is free software: you can redistribute it and/or modify
6+
// it under the terms of the GNU Affero General Public License as published by
7+
// the Free Software Foundation, either version 3 of the License, or
8+
// (at your option) any later version.
9+
//
10+
// This program is distributed in the hope that it will be useful
11+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
// GNU Affero General Public License for more details.
14+
//
15+
// You should have received a copy of the GNU Affero General Public License
16+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
18+
package cmd
19+
20+
import (
21+
"github.com/minio/cli"
22+
)
23+
24+
var adminAccesskeyCreateFlags = []cli.Flag{
25+
cli.StringFlag{
26+
Name: "access-key",
27+
Usage: "set an access key for the account",
28+
},
29+
cli.StringFlag{
30+
Name: "secret-key",
31+
Usage: "set a secret key for the account",
32+
},
33+
cli.StringFlag{
34+
Name: "policy",
35+
Usage: "path to a JSON policy file",
36+
},
37+
cli.StringFlag{
38+
Name: "name",
39+
Usage: "friendly name for the account",
40+
},
41+
cli.StringFlag{
42+
Name: "description",
43+
Usage: "description for the account",
44+
},
45+
cli.StringFlag{
46+
Name: "expiry-duration",
47+
Usage: "duration before the access key expires",
48+
},
49+
cli.StringFlag{
50+
Name: "expiry",
51+
Usage: "expiry date for the access key",
52+
},
53+
}
54+
55+
var adminAccesskeyCreateCmd = cli.Command{
56+
Name: "create",
57+
Usage: "create access key pairs for users",
58+
Action: mainAdminAccesskeyCreate,
59+
Before: setGlobalsFromContext,
60+
Flags: append(adminAccesskeyCreateFlags, globalFlags...),
61+
OnUsageError: onUsageError,
62+
CustomHelpTemplate: `NAME:
63+
{{.HelpName}} - {{.Usage}}
64+
65+
USAGE:
66+
{{.HelpName}} [FLAGS] [TARGET]
67+
68+
FLAGS:
69+
{{range .VisibleFlags}}{{.}}
70+
{{end}}
71+
EXAMPLES:
72+
1. Create a new access key pair with the same policy as the authenticated user
73+
{{.Prompt}} {{.HelpName}} myminio/
74+
75+
2. Create a new access key pair with custom access key and secret key
76+
{{.Prompt}} {{.HelpName}} myminio/ --access-key myaccesskey --secret-key mysecretkey
77+
78+
3. Create a new access key pair for user 'tester' that expires in 1 day
79+
{{.Prompt}} {{.HelpName}} myminio/ tester --expiry-duration 24h
80+
81+
4. Create a new access key pair for authenticated user that expires on 2025-01-01
82+
{{.Prompt}} {{.HelpName}} --expiry 2025-01-01
83+
84+
5. Create a new access key pair for user 'tester' with a custom policy
85+
{{.Prompt}} {{.HelpName}} myminio/ tester --policy /path/to/policy.json
86+
87+
6. Create a new access key pair for user 'tester' with a custom name and description
88+
{{.Prompt}} {{.HelpName}} myminio/ tester --name "Tester's Access Key" --description "Access key for tester"
89+
`,
90+
}
91+
92+
func mainAdminAccesskeyCreate(ctx *cli.Context) error {
93+
return commonAccesskeyCreate(ctx, false)
94+
}

cmd/admin-accesskey-disable.go

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Copyright (c) 2015-2024 MinIO, Inc.
2+
//
3+
// This file is part of MinIO Object Storage stack
4+
//
5+
// This program is free software: you can redistribute it and/or modify
6+
// it under the terms of the GNU Affero General Public License as published by
7+
// the Free Software Foundation, either version 3 of the License, or
8+
// (at your option) any later version.
9+
//
10+
// This program is distributed in the hope that it will be useful
11+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
// GNU Affero General Public License for more details.
14+
//
15+
// You should have received a copy of the GNU Affero General Public License
16+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
18+
package cmd
19+
20+
import (
21+
"github.com/minio/cli"
22+
)
23+
24+
var adminAccesskeyDisableCmd = cli.Command{
25+
Name: "disable",
26+
Usage: "disable an access key",
27+
Action: mainAdminAccesskeyDisable,
28+
Before: setGlobalsFromContext,
29+
Flags: globalFlags,
30+
OnUsageError: onUsageError,
31+
CustomHelpTemplate: `NAME:
32+
{{.HelpName}} - {{.Usage}}
33+
34+
USAGE:
35+
{{.HelpName}} [FLAGS] [TARGET]
36+
37+
FLAGS:
38+
{{range .VisibleFlags}}{{.}}
39+
{{end}}
40+
EXAMPLES:
41+
1. Disable access key
42+
{{.Prompt}} {{.HelpName}} myminio myaccesskey
43+
`,
44+
}
45+
46+
func mainAdminAccesskeyDisable(ctx *cli.Context) error {
47+
return enableDisableAccesskey(ctx, false)
48+
}

cmd/admin-accesskey-edit.go

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
// Copyright (c) 2015-2024 MinIO, Inc.
2+
//
3+
// This file is part of MinIO Object Storage stack
4+
//
5+
// This program is free software: you can redistribute it and/or modify
6+
// it under the terms of the GNU Affero General Public License as published by
7+
// the Free Software Foundation, either version 3 of the License, or
8+
// (at your option) any later version.
9+
//
10+
// This program is distributed in the hope that it will be useful
11+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
// GNU Affero General Public License for more details.
14+
//
15+
// You should have received a copy of the GNU Affero General Public License
16+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
18+
package cmd
19+
20+
import (
21+
"github.com/minio/cli"
22+
)
23+
24+
var adminAccesskeyEditFlags = []cli.Flag{
25+
cli.StringFlag{
26+
Name: "secret-key",
27+
Usage: "set a secret key for the account",
28+
},
29+
cli.StringFlag{
30+
Name: "policy",
31+
Usage: "path to a JSON policy file",
32+
},
33+
cli.StringFlag{
34+
Name: "name",
35+
Usage: "friendly name for the account",
36+
},
37+
cli.StringFlag{
38+
Name: "description",
39+
Usage: "description for the account",
40+
},
41+
cli.StringFlag{
42+
Name: "expiry-duration",
43+
Usage: "duration before the access key expires",
44+
},
45+
cli.StringFlag{
46+
Name: "expiry",
47+
Usage: "expiry date for the access key",
48+
},
49+
}
50+
51+
var adminAccesskeyEditCmd = cli.Command{
52+
Name: "edit",
53+
Usage: "edit existing access keys",
54+
Action: mainAdminAccesskeyEdit,
55+
Before: setGlobalsFromContext,
56+
Flags: append(adminAccesskeyEditFlags, globalFlags...),
57+
OnUsageError: onUsageError,
58+
CustomHelpTemplate: `NAME:
59+
{{.HelpName}} - {{.Usage}}
60+
61+
USAGE:
62+
{{.HelpName}} [FLAGS] [TARGET]
63+
64+
FLAGS:
65+
{{range .VisibleFlags}}{{.}}
66+
{{end}}
67+
EXAMPLES:
68+
1. Change the secret key for the access key "testkey"
69+
{{.Prompt}} {{.HelpName}} myminio/ testkey --secret-key 'xxxxxxx'
70+
2. Change the expiry duration for the access key "testkey"
71+
{{.Prompt}} {{.HelpName}} myminio/ testkey ---expiry-duration 24h
72+
`,
73+
}
74+
75+
func mainAdminAccesskeyEdit(ctx *cli.Context) error {
76+
return commonAccesskeyEdit(ctx)
77+
}

cmd/admin-accesskey-enable.go

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Copyright (c) 2015-2024 MinIO, Inc.
2+
//
3+
// This file is part of MinIO Object Storage stack
4+
//
5+
// This program is free software: you can redistribute it and/or modify
6+
// it under the terms of the GNU Affero General Public License as published by
7+
// the Free Software Foundation, either version 3 of the License, or
8+
// (at your option) any later version.
9+
//
10+
// This program is distributed in the hope that it will be useful
11+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
// GNU Affero General Public License for more details.
14+
//
15+
// You should have received a copy of the GNU Affero General Public License
16+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
18+
package cmd
19+
20+
import (
21+
"github.com/minio/cli"
22+
)
23+
24+
var adminAccesskeyEnableCmd = cli.Command{
25+
Name: "enable",
26+
Usage: "enable an access key",
27+
Action: mainAdminAccesskeyEnable,
28+
Before: setGlobalsFromContext,
29+
Flags: globalFlags,
30+
OnUsageError: onUsageError,
31+
CustomHelpTemplate: `NAME:
32+
{{.HelpName}} - {{.Usage}}
33+
34+
USAGE:
35+
{{.HelpName}} [FLAGS] [TARGET]
36+
37+
FLAGS:
38+
{{range .VisibleFlags}}{{.}}
39+
{{end}}
40+
EXAMPLES:
41+
1. Enable access key
42+
{{.Prompt}} {{.HelpName}} myminio myaccesskey
43+
`,
44+
}
45+
46+
func mainAdminAccesskeyEnable(ctx *cli.Context) error {
47+
return enableDisableAccesskey(ctx, true)
48+
}

cmd/admin-accesskey-info.go

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright (c) 2015-2023 MinIO, Inc.
2+
//
3+
// This file is part of MinIO Object Storage stack
4+
//
5+
// This program is free software: you can redistribute it and/or modify
6+
// it under the terms of the GNU Affero General Public License as published by
7+
// the Free Software Foundation, either version 3 of the License, or
8+
// (at your option) any later version.
9+
//
10+
// This program is distributed in the hope that it will be useful
11+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
// GNU Affero General Public License for more details.
14+
//
15+
// You should have received a copy of the GNU Affero General Public License
16+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
18+
package cmd
19+
20+
import (
21+
"github.com/minio/cli"
22+
)
23+
24+
var adminAccesskeyInfoCmd = cli.Command{
25+
Name: "info",
26+
Usage: "info about given access key pairs",
27+
Action: mainAdminAccesskeyInfo,
28+
Before: setGlobalsFromContext,
29+
Flags: globalFlags,
30+
OnUsageError: onUsageError,
31+
CustomHelpTemplate: `NAME:
32+
{{.HelpName}} - {{.Usage}}
33+
34+
USAGE:
35+
{{.HelpName}} [FLAGS] TARGET ACCESSKEY [ACCESSKEY...]
36+
37+
FLAGS:
38+
{{range .VisibleFlags}}{{.}}
39+
{{end}}
40+
EXAMPLES:
41+
1. Get info for the access key "testkey"
42+
{{.Prompt}} {{.HelpName}} local/ testkey
43+
2. Get info for the access keys "testkey" and "testkey2"
44+
{{.Prompt}} {{.HelpName}} local/ testkey testkey2
45+
`,
46+
}
47+
48+
func mainAdminAccesskeyInfo(ctx *cli.Context) error {
49+
return commonAccesskeyInfo(ctx)
50+
}

0 commit comments

Comments
 (0)