Skip to content

Commit

Permalink
feat(jsonschema,manifest): adds manifest and new schema for usergroup
Browse files Browse the repository at this point in the history
  • Loading branch information
swagnikdutta committed Jul 7, 2023
1 parent 3aed08a commit 7ee0560
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 0 deletions.
22 changes: 22 additions & 0 deletions riocli/apply/manifests/usergroup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
apiVersion: api.rapyuta.io/v2
kind: UserGroup
metadata:
name: test-usergroup
guid: e9377d2c-2e54-4e51-9b81-720876e4f198
creator: 6e36a251-aeeb-4b0b-bc26-bec7adc1c582
project: project-chuvg34jpuuhrd00vf5g
organization: org-bqgpmsafgnvnawlkuvxtxohs
labels:
label1: value1
spec:
description: Sample user group
members:
- guid: 6e36a251-aeeb-4b0b-bc26-bec7adc1c582
- guid: 213215e9-fec2-4fd1-b809-e447f22f3676
- guid: 7b4b2008-2852-4610-b7c1-5308e4231283
admins:
- guid: 6e36a251-aeeb-4b0b-bc26-bec7adc1c582
projects:
- guid: project-chuvg34jpuuhrd00vf5g
- guid: project-ci1i6ukjpuuhrd00vf7g
99 changes: 99 additions & 0 deletions riocli/jsonschema/schemas/usergroup-schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
$schema: http://json-schema.org/draft-07/schema#
title: UserGroup
description: A construct in rapyuta.io that allows one to grant access to projects to multiple users at once
$ref: "#/definitions/usergroup"
definitions:
usergroup:
type: object
properties:
apiVersion:
const: api.rapyuta.io/v2
default: api.rapyuta.io/v2
kind:
const: UserGroup
metadata:
"$ref": "#/definitions/metadata"
spec:
"$ref": "#/definitions/usergroupSpec"

required:
- apiVersion
- kind
- metadata
- spec

metadata:
type: object
properties:
name:
type: string
guid:
$ref: "#/definitions/uuid"
creator:
$ref: "#/definitions/uuid"
project:
$ref: "#/definitions/projectGUID"
organization:
$ref: "#/definitions/organizationGUID"
labels:
$ref: "#/definitions/stringMap"
uniqueItems: true

required:
- name
- organization

usergroupSpec:
type: object
properties:
description:
type: string
members:
type: array
items:
"$ref": "#/definitions/member"
admins:
type: array
items:
"$ref": "#/definitions/member"
projects:
type: array
items:
"$ref": "#/definitions/project"
additionalProperties: false

member:
type: object
properties:
guid:
type: string

required:
- guid

project:
type: object
properties:
guid:
type: string
pattern: "^project-([a-z0-9]{20}|[a-z]{24})$"
required:
- guid

stringMap:
type: object
additionalProperties:
type: string

projectGUID:
type: string
pattern: "^project-([a-z0-9]{20}|[a-z]{24})$"

organizationGUID:
type: string
pattern: "^org-([a-z0-9]{20}|[a-z]{24})$"

uuid:
type: string
pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"

0 comments on commit 7ee0560

Please sign in to comment.