ves-io-schema-secureshare_admin_policy-API-Create

Examples of creating secureshareadminpolicy

Usecase:

Create secureshare-admin-policy-1

Request using vesctl:

vesctl configuration create secureshare_admin_policy -i secureshare_admin_policy.yaml

where file secureshareadminpolicy.yaml has following contents (secureshareadminpolicy.CreateRequest):

metadata:
  name: secureshare-admin-policy-1
  namespace: documentation
spec:
  authorRestrictions:
    allowList:
      customList:
      - regexPattern: .*.sales@customer1.com
      - exactValue: user1@customer1.com
    denyList:
      customList:
      - regexPattern: .*.eng@customer1.com
  maxValidityDuration: 604800s
  userRestrictions:
  - tenant: customer2
    userRestrictions:
      allowList:
        customList:
        - regexPattern: .*.sales@customer1.com
      denyList:
        customList:
        - regexPattern: .*.eng@customer1.com
  - tenant: Volterra
    userRestrictions:
      allowList:
        customList:
        - regexPattern: .*@google.com
  - userRestrictions:
      allowList:
        customList:
        - regexPattern: .*@google.com
      denyList:
        customList:
        - regexPattern: .*@facebook.com

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: secureshare-admin-policy-1
  namespace: documentation
spec:
  authorRestrictions:
    allowList:
      customList:
      - regexPattern: .*.sales@customer1.com
      - exactValue: user1@customer1.com
    denyList:
      customList:
      - regexPattern: .*.eng@customer1.com
  maxValidityDuration: 604800s
  userRestrictions:
  - tenant: customer2
    userRestrictions:
      allowList:
        customList:
        - regexPattern: .*.sales@customer1.com
      denyList:
        customList:
        - regexPattern: .*.eng@customer1.com
  - tenant: Volterra
    userRestrictions:
      allowList:
        customList:
        - regexPattern: .*@google.com
  - userRestrictions:
      allowList:
        customList:
        - regexPattern: .*@google.com
      denyList:
        customList:
        - regexPattern: .*@facebook.com
systemMetadata:
  creationTimestamp: "2020-07-02T15:53:29.033267Z"
  creatorClass: examplesvc.ves.io
  finalizers: []
  tenant: acmecorp
  uid: cedeb444-b51a-4554-9740-d1b3247eb691

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"secureshare-admin-policy-1","namespace":"documentation"},"spec":{"maxValidityDuration":"604800s","authorRestrictions":{"allowList":{"customList":[{"regexPattern":".*.sales@customer1.com"},{"exactValue":"user1@customer1.com"}]},"denyList":{"customList":[{"regexPattern":".*.eng@customer1.com"}]}},"userRestrictions":[{"tenant":"customer2","userRestrictions":{"allowList":{"customList":[{"regexPattern":".*.sales@customer1.com"}]},"denyList":{"customList":[{"regexPattern":".*.eng@customer1.com"}]}}},{"tenant":"Volterra","userRestrictions":{"allowList":{"customList":[{"regexPattern":".*@google.com"}]}}},{"userRestrictions":{"allowList":{"customList":[{"regexPattern":".*@google.com"}]},"denyList":{"customList":[{"regexPattern":".*@facebook.com"}]}}}]}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build743694289_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/secret_management/namespaces/documentation/secureshare_admin_policys'

curl response:

HTTP/1.1 200 OK
Content-Type: application/json
Date: Thu, 02 Jul 2020 15:53:29 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "secureshare-admin-policy-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "cedeb444-b51a-4554-9740-d1b3247eb691",
    "creation_timestamp": "2020-07-02T15:53:29.033267Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc.ves.io",
    "creator_id": "",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "max_validity_duration": "604800s",
    "author_restrictions": {
      "allow_list": {
        "custom_list": [
          {
            "regex_pattern": ".*.sales@customer1.com"
          },
          {
            "exact_value": "user1@customer1.com"
          }
        ]
      },
      "deny_list": {
        "custom_list": [
          {
            "regex_pattern": ".*.eng@customer1.com"
          }
        ]
      }
    },
    "user_restrictions": [
      {
        "tenant": "customer2",
        "user_restrictions": {
          "allow_list": {
            "custom_list": [
              {
                "regex_pattern": ".*.sales@customer1.com"
              }
            ]
          },
          "deny_list": {
            "custom_list": [
              {
                "regex_pattern": ".*.eng@customer1.com"
              }
            ]
          }
        }
      },
      {
        "tenant": "Volterra",
        "user_restrictions": {
          "allow_list": {
            "custom_list": [
              {
                "regex_pattern": ".*@google.com"
              }
            ]
          }
        }
      },
      {
        "user_restrictions": {
          "allow_list": {
            "custom_list": [
              {
                "regex_pattern": ".*@google.com"
              }
            ]
          },
          "deny_list": {
            "custom_list": [
              {
                "regex_pattern": ".*@facebook.com"
              }
            ]
          }
        }
      }
    ]
  }
}