2023-01-23 10:10:51 -06:00
|
|
|
// This file is part of MinIO Console Server
|
|
|
|
|
// Copyright (c) 2023 MinIO, Inc.
|
|
|
|
|
//
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU Affero General Public License as published by
|
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU Affero General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
2023-12-26 15:07:30 -06:00
|
|
|
package api
|
2023-01-23 10:10:51 -06:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
2023-06-21 10:51:12 -07:00
|
|
|
"github.com/minio/madmin-go/v3"
|
2023-01-23 10:10:51 -06:00
|
|
|
)
|
|
|
|
|
|
2025-03-21 20:43:10 +01:00
|
|
|
type AdminClientMock struct {
|
|
|
|
|
minioAccountInfoMock func(ctx context.Context) (madmin.AccountInfo, error)
|
2023-01-23 10:10:51 -06:00
|
|
|
}
|
|
|
|
|
|
2023-03-22 15:06:04 -06:00
|
|
|
func (ac AdminClientMock) kmsStatus(_ context.Context) (madmin.KMSStatus, error) {
|
2023-01-23 10:10:51 -06:00
|
|
|
return madmin.KMSStatus{Name: "name", DefaultKeyID: "key", Endpoints: map[string]madmin.ItemState{"localhost": madmin.ItemState("online")}}, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (ac AdminClientMock) AccountInfo(ctx context.Context) (madmin.AccountInfo, error) {
|
2025-03-21 20:43:10 +01:00
|
|
|
return ac.minioAccountInfoMock(ctx)
|
2023-03-10 09:16:29 -06:00
|
|
|
}
|