mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 02:15:43 +03:00
This PR introduces a new Consul client that returns SI tokens based on requests that contain JWTs.
20 lines
411 B
Go
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
|
|
}
|