scim

package
v0.0.0-...-0849d52 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// FolderSchema is ..
	FolderSchema = "/schemas/"
	// FolderResoruceType is ..
	FolderResoruceType = "/resourceType/"
	PREFIX             = "/scim/v2"
)

Variables

View Source
var (
	// Resources ...
	Resources map[string]ResoruceType
	// Schemas ...
	Schemas map[string]Schema
)
View Source
var (
	//Cluster ...
	Cluster             *gocb.Cluster
	FolderBucketSetting = "config/bucketSettings/"
)

Functions

func Bulk

func Bulk(c *gin.Context)

Bulk is POST https://example.com/{v}/Bulk

func ContainsSchemaExtension

func ContainsSchemaExtension(slice []SchemaExtension, item string) bool

ContainsSchemaExtension is

func ContainsString

func ContainsString(slice []string, item string) bool

ContainsString is

func ContainsStringInArrayInterfase

func ContainsStringInArrayInterfase(slice []interface{}, item string) bool

ContainsStringInArrayInterfase is

func Create

func Create(resource string) func(c *gin.Context)

Create is POST https://example.com/{v}/{resource}

func CreateBucket

func CreateBucket(name string)

CreateBucket ...

func Delete

func Delete(resource string) func(c *gin.Context)

Delete is DELETE https://example.com/{v}/{resource}/{id}

func DiscoveryResourceTypes

func DiscoveryResourceTypes(c *gin.Context)

DiscoveryResourceTypes is An endpoint used to discover the types of resources available.

func DiscoverySchemas

func DiscoverySchemas(c *gin.Context)

DiscoverySchemas is Introspect resources and attribute extensions.

func DiscoveryServiceProviderConfig

func DiscoveryServiceProviderConfig(c *gin.Context)

DiscoveryServiceProviderConfig is Specification compliance, authentication schemes, data models.

func InitDB

func InitDB()

InitDB ..

func Read

func Read(resource string) func(c *gin.Context)

Read is GET https://example.com/{v}/{resource}/{id}

func ReadResourceType

func ReadResourceType(folderConfig string, r *gin.Engine)

ReadResourceType read all file in resourceType

func Replace

func Replace(resource string) func(c *gin.Context)

Replace is PUT https://example.com/{v}/{resource}/{id}

func Search(resource string) func(c *gin.Context)

Search is GET https://example.com/{v}/{resource}?filter={attribute}{op}{value}&sortBy={attributeName}&sortOrder={ascending|descending}

func Update

func Update(resource string) func(c *gin.Context)

Update is PATCH https://example.com/{v}/{resource}/{id}

func ValidateFieldSchemas

func ValidateFieldSchemas(c *gin.Context, element map[string]interface{}, resourceType ResoruceType) (bool, []string)

ValidateFieldSchemas is ..

func ValidateReadRole

func ValidateReadRole(roles []string, resourceType ResoruceType, element map[string]interface{}) map[string]interface{}

func ValidateSchemas

func ValidateSchemas(c *gin.Context, element map[string]interface{}, schemaNameCore string, schemas []SchemaExtension) (bool, map[string]interface{})

ValidateSchemas is

Types

type Attribute

type Attribute struct {
	Name          string      `json:"name"`
	Type          string      `json:"type"`
	MultiValued   bool        `json:"multiValued"`
	Description   string      `json:"description"`
	Required      bool        `json:"required"`
	CaseExact     bool        `json:"caseExact"`
	Mutability    string      `json:"mutability"`
	Returned      string      `json:"returned"`
	Uniqueness    string      `json:"uniqueness"`
	Writer        *[]string   `json:"$writer"`
	Read          *[]string   `json:"$reader"`
	SubAttributes []Attribute `json:"subAttributes"`
}

Attribute is of SCIM

func GetAttribute

func GetAttribute(attributes []Attribute, path string) Attribute

type ConfigBucket

type ConfigBucket struct {
	FlushEnabled           *bool   `json:"flush_enabled"`
	ReplicaIndexDisabled   *bool   `json:"replica_index_disabled"`
	RAMQuotaMb             *uint64 `json:"ram_quota_mb"`
	NumReplicas            *uint32 `json:"num_replicas"`
	BucketType             *string `json:"bucket_type"`
	CompressionMode        *string `json:"compression_mode"`
	MaxExpiry              *string `json:"MaxExpiry"`
	EvictionPolicy         *string `json:"EvictionPolicy"`
	ConflictResolutionType *string `json:"conflict_resolution_type"`
}

type Error

type Error struct {
	Schemas []string `json:"schemas"`
	Detail  string   `json:"detail"`
	Status  string   `json:"status"`
}

Error is ..

func MakeError

func MakeError(c *gin.Context, status int, message string) Error

MakeError ...

type ListResponse

type ListResponse struct {
	Schemas      []string      `json:"schemas"`
	TotalResults int           `json:"totalResults,omitempty"`
	ItemsPerPage int           `json:"itemsPerPage,omitempty"`
	StartIndex   int           `json:"startIndex,omitempty"`
	Resources    []interface{} `json:"Resources,omitempty"`
}

ListResponse is of SCIM

type Meta

type Meta struct {
	ResourceType string `json:"resourceType"`
	Created      string `json:"created"`
	LastModified string `json:"lastModified"`
	Version      string `json:"version"`
	Location     string `json:"location"`
}

Meta is of SCIM

type Operation

type Operation struct {
	Op    string      `json:"op"` // "add", "remove", or "replace"
	Path  string      `json:"path"`
	Value interface{} `json:"value"`
}

Operation ...

type Patch

type Patch struct {
	Schemas    []string    `json:"schemas"`
	Operations []Operation `json:"Operations"`
}

Patch is 3.5.2. Modifying with PATCH HTTP PATCH is an OPTIONAL server function that enables clients to update one or more attributes of a SCIM resource using a sequence of operations to "add", "remove", or "replace" values. Clients may discover service provider support for PATCH by querying the service provider configuration (see Section 4).

type ResoruceType

type ResoruceType struct {
	Schemas          []string          `json:"schemas"`
	ID               string            `json:"id"`
	Name             string            `json:"name"`
	Endpoint         string            `json:"endpoint"`
	Description      string            `json:"description"`
	Schema           string            `json:"schema"`
	SchemaExtensions []SchemaExtension `json:"schemaExtensions"`
	Meta             Meta              `json:"meta"`
}

ResoruceType is of SCIM

type Resource

type Resource map[string]interface{}

Resource is of SCIM

type Schema

type Schema struct {
	ID          string      `json:"id"`
	Name        string      `json:"name"`
	Description string      `json:"description"`
	Attributes  []Attribute `json:"attributes"`
	Meta        Meta        `json:"meta"`
}

Schema is of SCIM

type SchemaExtension

type SchemaExtension struct {
	Schema   string `json:"schema"`
	Required bool   `json:"required"`
}

SchemaExtension is of SCIM

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL