Documentation ¶
Index ¶
- Constants
- func CreateObjects(obj *crest.FRObject, overwrite, continueOnError bool) (err error)
- func PolicytoYAML(policies []Policy)
- type AuthNResponse
- type OpenAMConnection
- func (am *OpenAMConnection) Authenticate() error
- func (am *OpenAMConnection) CreatePolicies(obj *crest.FRObject, overWrite, continueOnError bool) (err error)
- func (am *OpenAMConnection) CreatePolicy(p map[string]interface{}, overWrite bool, realm string) (err error)
- func (am *OpenAMConnection) DeletePolicy(name, realm string) (err error)
- func (openam *OpenAMConnection) ExportPolicies(format, realm string) (out string, err error)
- func (openam *OpenAMConnection) ExportXacmlPolicies() (string, error)
- func (openam *OpenAMConnection) ImportPoliciesFromFile(filePath string) error
- func (openam *OpenAMConnection) ListResourceTypes() ([]ResourceType, error)
- type Policy
- type PolicyArray
- type PolicyResultList
- type ResourceType
- type ResourceTypeResult
Constants ¶
const (
POLICY = "am.policy"
)
object types we know how to read/create
Variables ¶
This section is empty.
Functions ¶
func CreateObjects ¶
func PolicytoYAML ¶
func PolicytoYAML(policies []Policy)
Types ¶
type AuthNResponse ¶
type AuthNResponse struct { TokenID string `json: "tokenId"` SuccessURL string `json:"successUrl"` }
AuthNResponse returned by OpenAM on authenticate request
type OpenAMConnection ¶
type OpenAMConnection struct { BaseURL string // base URL including /openam. Example: http://openam.example.com:8080/openam User string Password string Realm string // contains filtered or unexported fields }
OpenAMConnection to an openam server instance
func GetOpenAMConnection ¶
func GetOpenAMConnection() (am *OpenAMConnection, err error)
Create an OpenAM connection based on viper config file
func Open ¶
func Open(url, user, password string) (am *OpenAMConnection, err error)
func (*OpenAMConnection) Authenticate ¶
func (am *OpenAMConnection) Authenticate() error
Authenticate to OpenAM. Set the AuthN token in the connection for subsequent requests
func (*OpenAMConnection) CreatePolicies ¶
func (am *OpenAMConnection) CreatePolicies(obj *crest.FRObject, overWrite, continueOnError bool) (err error)
Create Policies in OpenAM instance. If continueOnError is true, keep trying to create policies even if a single create fails. If overWrite is true, First delete the policy and then create it
func (*OpenAMConnection) CreatePolicy ¶
func (am *OpenAMConnection) CreatePolicy(p map[string]interface{}, overWrite bool, realm string) (err error)
Create a single policy described by the json
func (*OpenAMConnection) DeletePolicy ¶
func (am *OpenAMConnection) DeletePolicy(name, realm string) (err error)
Delete the named policy. If the policy does exist, we do not return an error code
func (*OpenAMConnection) ExportPolicies ¶
func (openam *OpenAMConnection) ExportPolicies(format, realm string) (out string, err error)
Export all the policies as a JSON or YAML policy set string
func (*OpenAMConnection) ExportXacmlPolicies ¶
func (openam *OpenAMConnection) ExportXacmlPolicies() (string, error)
Export all the policies as a XACML policy set
func (*OpenAMConnection) ImportPoliciesFromFile ¶
func (openam *OpenAMConnection) ImportPoliciesFromFile(filePath string) error
func (*OpenAMConnection) ListResourceTypes ¶
func (openam *OpenAMConnection) ListResourceTypes() ([]ResourceType, error)
ListResourceTypes returns the OpenAM policy resource types
type Policy ¶
type Policy struct { Name string `json:"name"` Active bool `json:"active"` ApplicationName string `json:"applicationName"` ActionValues interface{} `json:"actionValues"` Resources []string `json:"resources"` Description string `json:"description"` Subject interface{} `json:"subject"` Condition interface{} `json:"condition"` ResourceTypeUUID string `json:"resourceTypeUuid"` CreatedBy string `json:"createdBy"` CreationDate string `json:"creationDate"` LastModifiedBy string `json:"lastModifiedBy"` LastModifiedDate string `json:"lastModifiedDate"` }
Policy in OpenAMConnection
func ListPolicy ¶
func ListPolicy(openam *OpenAMConnection) ([]Policy, error)
ListPolicy lists all OpenAM policies for a realm
type PolicyArray ¶
type PolicyArray []interface{}
type PolicyResultList ¶
type PolicyResultList struct { Result []Policy `json:"result"` ResultCount int64 `json:"resultCount"` PagedResultsCookie string `json:"pagedResultsCookie` RemainingPagedResults int64 `json:"remainingPagedResults"` }
A PolicyResultList is a set of Policies
type ResourceType ¶
type ResourceType struct { UUID string `json: "uuid"` Name string `json: "name"` Description string `json: "description"` Patterns []string `json: "patterns"` Actions interface{} `json: "actions"` CreatedBy string `json: "createdBy"` CreationDate int64 `json: "creationDate"` LastModifiedBy string `json: "lastModifiedBy"` LastModifiedDate int64 `json: "lastModifiedDate"` }
ResourceType is an OpenAM policy resource type
type ResourceTypeResult ¶
type ResourceTypeResult struct { Result []ResourceType `json: "result"` ResultCount int64 `json: "resultCount"` PagedResultsCookie string `json: "pagedResultsCookie` RemainingPagedResults int64 `json: "remainingPagedResults"` }