26 lines
769 B
Go
26 lines
769 B
Go
package libpolicy
|
|
|
|
// Policy represents the top-level structure of your custom policy.json
|
|
type Policy struct {
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
Conditions []Condition `json:"conditions"`
|
|
}
|
|
|
|
// Condition represents each item in the "conditions" array
|
|
type Condition struct {
|
|
StatementID string `json:"statementid"`
|
|
Principal []string `json:"principals"`
|
|
Actions []string `json:"actions"`
|
|
Source []string `json:"source"`
|
|
Effect string `json:"effect"`
|
|
Operator string `json:"operator"`
|
|
}
|
|
|
|
type Request struct {
|
|
Principal string `json:"principal"`
|
|
SourceIPAddress string `json:"source_ipaddress"`
|
|
Action string `json:"action"`
|
|
Target string `json:"target"`
|
|
}
|