-
Notifications
You must be signed in to change notification settings - Fork 1
/
aws_api_clientvalues.go
63 lines (50 loc) · 1.72 KB
/
aws_api_clientvalues.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
package avpTestSupport
import (
"fmt"
"github.com/hexa-org/policy-mapper/api/policyprovider"
)
const TestAwsRegion = "us-west-1"
const TestAwsAccessKeyId = "anAccessKeyID"
const TestAwsSecretAccessKey = "aSecretAccessKey"
const TestPolicyStoreArn = "arn:aws:verifiedpermissions::773752081234:policy-store/K21RFtXLb2qPRGA93DH7z5"
var TestPolicyStoreId = "K21RFtXLb2qPRGA93DH7z5"
const TestPolicyStoreDescription = "Test Policy Store"
const TestResourceServerIdentifier = "https://some-resource-server"
var TestCedarStaticPolicyDescription = "Simple static policy"
var TestCedarStaticPolicy = `
permit(
principal,
action in [hexa_avp::Action::"ReadAccount",hexa_avp::Action::"Transfer",hexa_avp::Action::"Deposit",hexa_avp::Action::"Withdrawl"],
resource
);`
var TestCedarStaticPolicyId = "id1"
var TestCedarTemplatePolicy = `
permit(
principal == ?principal,
action in [hexa_avp::Action::"ReadAccount"],
resource == ?resource
);`
var TestCedarTemplatePolicyId = "id2"
var TestCedarTemplateId = "temp1"
// const TestResourceServerName = "some-resource-server-name"
func AwsCredentialsForTest() []byte {
str := fmt.Sprintf(`
{
"accessKeyID": "%s",
"secretAccessKey": "%s",
"region": "%s"
}
`, TestAwsAccessKeyId, TestAwsSecretAccessKey, TestAwsRegion)
return []byte(str)
}
func IntegrationInfo() policyprovider.IntegrationInfo {
return policyprovider.IntegrationInfo{Name: policyprovider.PROVIDER_TYPE_AVP, Key: AwsCredentialsForTest()}
}
func AppInfo() policyprovider.ApplicationInfo {
return policyprovider.ApplicationInfo{
ObjectID: TestPolicyStoreId,
Name: "Test Policy Store",
Description: "AVP Mock Test",
Service: TestResourceServerIdentifier,
}
}