Skip to content

Commit

Permalink
Merge pull request #28 from sailpoint-oss/fning/PLTCONN-2932
Browse files Browse the repository at this point in the history
PLTCONN-2932: Allow schema to be pass down to connector process
  • Loading branch information
fangming-ning-sp committed Apr 28, 2023
2 parents 461e3f3 + 45303f5 commit 82599c8
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 22 deletions.
24 changes: 24 additions & 0 deletions lib/commands/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export type SchemaAttribute = {
name: string,
description: string,
type: string,
required?: boolean,
multi?: boolean,
managed?: boolean,
entitlement?: boolean
Expand Down Expand Up @@ -132,3 +133,26 @@ export type ObjectOutput = { identity: string, uuid?: string } | { key: Key }
export type CommandState = {
[key: string]: any
}

/**
* The common schema
*/
export type Schema = {
displayAttribute: string
identityAttribute: string
attributes: SchemaAttribute[]
}

/**
* Account schema
*/
export type AccountSchema = Schema & {
groupAttribute: string
}

/**
* Entitlement schema
*/
export type EntitlementSchema = Schema & {
type: string
}
3 changes: 2 additions & 1 deletion lib/commands/std-account-create.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/* Copyright (c) 2021. SailPoint Technologies, Inc. All rights reserved. */

import { Attributes, ObjectOutput } from './command'
import { AccountSchema, Attributes, ObjectOutput } from './command'

/**
* Input object of `std:account:create` command
*/
export type StdAccountCreateInput = {
identity?: string
attributes: any
schema?: AccountSchema
}

/**
Expand Down
6 changes: 4 additions & 2 deletions lib/commands/std-account-delete.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/* Copyright (c) 2021. SailPoint Technologies, Inc. All rights reserved. */

import {ObjectInput} from "./command"
import {AccountSchema, ObjectInput} from "./command"

/**
* Input object of `std:account:delete` command
*/
export type StdAccountDeleteInput = ObjectInput
export type StdAccountDeleteInput = ObjectInput & {
schema?: AccountSchema
}

/**
* Output object of `std:account:delete` command
Expand Down
6 changes: 4 additions & 2 deletions lib/commands/std-account-disable.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/* Copyright (c) 2022. SailPoint Technologies, Inc. All rights reserved. */

import { Attributes, ObjectInput, ObjectOutput } from './command'
import { AccountSchema, Attributes, ObjectInput, ObjectOutput } from './command'

/**
* Input object of `std:account:disable` command
*/
export type StdAccountDisableInput = ObjectInput
export type StdAccountDisableInput = ObjectInput & {
schema?: AccountSchema
}

/**
* Output object of `std:account:disable` command
Expand Down
9 changes: 2 additions & 7 deletions lib/commands/std-account-discover-schema.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
/* Copyright (c) 2021. SailPoint Technologies, Inc. All rights reserved. */

import { SchemaAttribute } from "./command";
import { AccountSchema } from "./command";

/**
* Output object of `std:account:discover-schema` command
*/
export type StdAccountDiscoverSchemaOutput = {
displayAttribute: string
groupAttribute: string
identityAttribute: string
attributes: SchemaAttribute[]
}
export type StdAccountDiscoverSchemaOutput = AccountSchema
6 changes: 4 additions & 2 deletions lib/commands/std-account-enable.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/* Copyright (c) 2022. SailPoint Technologies, Inc. All rights reserved. */

import { Attributes, ObjectInput, ObjectOutput } from './command'
import { AccountSchema, Attributes, ObjectInput, ObjectOutput } from './command'

/**
* Input object of `std:account:enable` command
*/
export type StdAccountEnableInput = ObjectInput
export type StdAccountEnableInput = ObjectInput & {
schema?: AccountSchema
}

/**
* Output object of `std:account:enable` command
Expand Down
3 changes: 2 additions & 1 deletion lib/commands/std-account-list.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/* Copyright (c) 2021. SailPoint Technologies, Inc. All rights reserved. */

import { Attributes, CommandState, ObjectOutput } from './command'
import { AccountSchema, Attributes, CommandState, ObjectOutput } from './command'

/**
* Input object of `std:account:list` command
*/
export type StdAccountListInput = {
stateful?: boolean
state?: CommandState
schema?: AccountSchema
}

/**
Expand Down
6 changes: 4 additions & 2 deletions lib/commands/std-account-read.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/* Copyright (c) 2021. SailPoint Technologies, Inc. All rights reserved. */

import { Attributes, ObjectInput, ObjectOutput } from './command'
import { AccountSchema, Attributes, ObjectInput, ObjectOutput } from './command'

/**
* Input object of `std:account:read` command
*/
export type StdAccountReadInput = ObjectInput
export type StdAccountReadInput = ObjectInput & {
schema?: AccountSchema
}

/**
* Output object of `std:account:read` command
Expand Down
6 changes: 4 additions & 2 deletions lib/commands/std-account-unlock.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/* Copyright (c) 2022. SailPoint Technologies, Inc. All rights reserved. */

import { Attributes, ObjectInput, ObjectOutput } from './command'
import { AccountSchema, Attributes, ObjectInput, ObjectOutput } from './command'

/**
* Input object of `std:account:unlock` command
*/
export type StdAccountUnlockInput = ObjectInput
export type StdAccountUnlockInput = ObjectInput & {
schema?: AccountSchema
}

/**
* Output object of `std:account:unlock` command
Expand Down
3 changes: 2 additions & 1 deletion lib/commands/std-account-update.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Copyright (c) 2021. SailPoint Technologies, Inc. All rights reserved. */

import { Attributes, ObjectInput, ObjectOutput } from './command'
import { AccountSchema, Attributes, ObjectInput, ObjectOutput } from './command'

export enum AttributeChangeOp {
Add = 'Add',
Expand All @@ -22,6 +22,7 @@ export type AttributeChange = {
*/
export type StdAccountUpdateInput = ObjectInput & {
changes: AttributeChange[]
schema?: AccountSchema
}

/**
Expand Down
3 changes: 2 additions & 1 deletion lib/commands/std-entitlement-list.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Copyright (c) 2021. SailPoint Technologies, Inc. All rights reserved. */

import { Attributes, CommandState, ObjectOutput } from './command'
import { Attributes, CommandState, EntitlementSchema, ObjectOutput } from './command'

/**
* Input object of `std:entitlement:list` command
Expand All @@ -9,6 +9,7 @@ export type StdEntitlementListInput = {
type: string
stateful?: boolean
state?: CommandState
schema?: EntitlementSchema
}

/**
Expand Down
3 changes: 2 additions & 1 deletion lib/commands/std-entitlement-read.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/* Copyright (c) 2021. SailPoint Technologies, Inc. All rights reserved. */

import { Attributes, ObjectInput, ObjectOutput } from './command'
import { Attributes, EntitlementSchema, ObjectInput, ObjectOutput } from './command'

/**
* Input object of `std:entitlement:read` command
*/
export type StdEntitlementReadInput = ObjectInput & {
type: string
schema?: EntitlementSchema
}

/**
Expand Down

0 comments on commit 82599c8

Please sign in to comment.