/
fake_secret_provider.go
66 lines (55 loc) · 1.84 KB
/
fake_secret_provider.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*******************************************************************************
* IBM Confidential
* OCO Source Materials
* IBM Cloud Kubernetes Service, 5737-D43
* (C) Copyright IBM Corp. 2022 All Rights Reserved.
* The source code for this program is not published or otherwise divested of
* its trade secrets, irrespective of what has been deposited with
* the U.S. Copyright Office.
******************************************************************************/
// Package secretprovider ...
package secret_provider
import (
"errors"
)
const (
// fakeEndpoint ...
fakeEndpoint = "https://fakehost.com"
)
// FakeSecretProvider ...
type FakeSecretProvider struct {
}
// GetDefaultIAMToken ...
func (fs *FakeSecretProvider) GetDefaultIAMToken(freshTokenRequired bool, reasonForCall ...string) (string, uint64, error) {
if freshTokenRequired {
return "token", 1000, nil
}
return "", 0, errors.New("fake error")
}
// GetIAMToken ...
func (fs *FakeSecretProvider) GetIAMToken(secret string, freshTokenRequired bool, reasonForCall ...string) (string, uint64, error) {
if freshTokenRequired {
return "token", 1000, nil
}
return "", 0, errors.New("fake error")
}
// GetRIAASEndpoint ...
func (fs *FakeSecretProvider) GetRIAASEndpoint(readConfig bool) (string, error) {
return fakeEndpoint, nil
}
// GetPrivateRIAASEndpoint ...
func (fs *FakeSecretProvider) GetPrivateRIAASEndpoint(readConfig bool) (string, error) {
return fakeEndpoint, nil
}
// GetContainerAPIRoute ...
func (fs *FakeSecretProvider) GetContainerAPIRoute(readConfig bool) (string, error) {
return fakeEndpoint, nil
}
// GetPrivateContainerAPIRoute ...
func (fs *FakeSecretProvider) GetPrivateContainerAPIRoute(readConfig bool) (string, error) {
return fakeEndpoint, nil
}
// GetResourceGroupID ...
func (fs *FakeSecretProvider) GetResourceGroupID() string {
return "resource-group-id"
}