Files
threshold-plugin-minio/internal/client/service_test.go
T
shadowdaoandClaude Sonnet 5.5 6628c9dbeb Rename module and SDK import paths for Threshold
Fork of hashicorp/boundary-plugin-minio (MPL-2.0). Module path and Boundary SDK
imports now point at repo.anhonesthost.net/CyberCoveLLC. Adds NOTICE and an
About this fork section to the README.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 10:28:07 -07:00

40 lines
1.1 KiB
Go

// Copyright IBM Corp. 2025, 2026
// SPDX-License-Identifier: MPL-2.0
package client_test
import (
"context"
"testing"
"repo.anhonesthost.net/CyberCoveLLC/threshold-plugin-minio/internal/client"
internaltest "repo.anhonesthost.net/CyberCoveLLC/threshold-plugin-minio/internal/testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestServiceAccount(t *testing.T) {
t.Parallel()
ctx := context.Background()
assert, require := assert.New(t), require.New(t)
server := internaltest.NewMinioServer(t)
c, err := client.New(server.ApiAddr, server.RootUsername, server.RootPassword)
require.NoError(err)
assert.NotNil(c)
creds, err := c.AddServiceAccount(ctx, client.AddServiceAccountReq{})
require.NoError(err)
// We just added service account it should be valid
err = c.EnsureServiceAccount(ctx, creds.AccessKeyId)
require.NoError(err)
err = c.DeleteServiceAccount(ctx, creds.AccessKeyId)
require.NoError(err)
// Now that we have deleted the service account it should be invalid
err = c.EnsureServiceAccount(ctx, creds.AccessKeyId)
require.Error(err)
}