Files
nomad/client/consul/consul_testing.go
Piotr Kazmierczak 2fffb96604 client: new Consul client (#18370)
This PR introduces a new Consul client that returns SI tokens based on requests
that contain JWTs.
2023-09-05 20:55:36 +02:00

20 lines
411 B
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package consul
import (
"github.com/hashicorp/nomad/helper/uuid"
)
type MockConsulClient struct{}
func (mc *MockConsulClient) DeriveSITokenWithJWT(reqs map[string]JWTLoginRequest) (map[string]string, error) {
tokens := make(map[string]string, len(reqs))
for id := range reqs {
tokens[id] = uuid.Generate()
}
return tokens, nil
}