forked from opengovern/og-describer-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
credentials.go
43 lines (34 loc) · 1.33 KB
/
credentials.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
package provider
import (
"encoding/json"
model "github.com/opengovern/og-describer-doppler/pkg/sdk/models"
"github.com/opengovern/og-describer-doppler/provider/configs"
"github.com/opengovern/og-util/pkg/describe"
)
// AccountCredentialsFromMap TODO: converts a map to an configs.IntegrationCredentials.
func AccountCredentialsFromMap(m map[string]any) (configs.IntegrationCredentials, error) {
mj, err := json.Marshal(m)
if err != nil {
return configs.IntegrationCredentials{}, err
}
var c configs.IntegrationCredentials
err = json.Unmarshal(mj, &c)
if err != nil {
return configs.IntegrationCredentials{}, err
}
return c, nil
}
// GetResourceMetadata TODO: Get metadata as a map to add to the resources
func GetResourceMetadata(job describe.DescribeJob, resource model.Resource) (map[string]string, error) {
metadata := make(map[string]string)
return metadata, nil
}
// AdjustResource TODO: Do any needed adjustment on resource object before storing
func AdjustResource(job describe.DescribeJob, resource *model.Resource) error {
return nil
}
// GetAdditionalParameters TODO: pass additional parameters needed in describer wrappers in /provider/describer_wrapper.go
func GetAdditionalParameters(job describe.DescribeJob) (map[string]string, error) {
additionalParameters := make(map[string]string)
return additionalParameters, nil
}