Skip to content

Commit

Permalink
fix(IAM Policy Management): add nested conditions to rule.conditions (#…
Browse files Browse the repository at this point in the history
…233)

* fix(IAM Policy Management): Added nest conditions to rule.conditions

Signed-off-by: Shaun Colley <[email protected]>
  • Loading branch information
swcolley authored Nov 7, 2023
1 parent f6e309f commit 15be7c6
Showing 1 changed file with 55 additions and 39 deletions.
94 changes: 55 additions & 39 deletions iam-policy-management/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3052,6 +3052,9 @@ namespace IamPolicyManagementV1 {
limit?: number;
}

/** Condition that specifies additional conditions or RuleAttribute to grant access.s. */
export interface NestedCondition {}

/** The core set of properties associated with a policy. */
export interface Policy {
/** The policy ID. */
Expand Down Expand Up @@ -3430,41 +3433,6 @@ namespace IamPolicyManagementV1 {
}
}

/** Rule that specifies additional conditions. */
export interface RuleAttributeWithConditions {
/** The name of an attribute. */
key?: string;
/** The operator of an attribute. */
operator: RuleAttributeWithConditions.Constants.Operator | string;
/** The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or
* an array of strings (e.g., array of days to permit access) for rule attribute.
*/
value?: any;
/** List of additional conditions associated with a policy, e.g., time-based conditions that grant access over a
* certain time period.
*/
conditions?: RuleAttribute[];
}
export namespace RuleAttributeWithConditions {
export namespace Constants {
/** The operator of an attribute. */
export enum Operator {
TIMELESSTHAN = 'timeLessThan',
TIMELESSTHANOREQUALS = 'timeLessThanOrEquals',
TIMEGREATERTHAN = 'timeGreaterThan',
TIMEGREATERTHANOREQUALS = 'timeGreaterThanOrEquals',
DATETIMELESSTHAN = 'dateTimeLessThan',
DATETIMELESSTHANOREQUALS = 'dateTimeLessThanOrEquals',
DATETIMEGREATERTHAN = 'dateTimeGreaterThan',
DATETIMEGREATERTHANOREQUALS = 'dateTimeGreaterThanOrEquals',
DAYOFWEEKEQUALS = 'dayOfWeekEquals',
DAYOFWEEKANYOF = 'dayOfWeekAnyOf',
AND = 'and',
OR = 'or',
}
}
}

/** An attribute associated with a subject. */
export interface SubjectAttribute {
/** The name of an attribute. */
Expand Down Expand Up @@ -3729,6 +3697,54 @@ namespace IamPolicyManagementV1 {
grant: GrantWithEnrichedRoles;
}

/** Rule that specifies additional access granted (e.g., time-based condition). */
export interface NestedConditionRuleAttribute extends NestedCondition {
/** The name of an attribute. */
key: string;
/** The operator of an attribute. */
operator: NestedConditionRuleAttribute.Constants.Operator | string;
/** The value of a rule or resource attribute; can be boolean or string for resource attribute. Can be string or
* an array of strings (e.g., array of days to permit access) for rule attribute.
*/
value: any;
}
export namespace NestedConditionRuleAttribute {
export namespace Constants {
/** The operator of an attribute. */
export enum Operator {
TIMELESSTHAN = 'timeLessThan',
TIMELESSTHANOREQUALS = 'timeLessThanOrEquals',
TIMEGREATERTHAN = 'timeGreaterThan',
TIMEGREATERTHANOREQUALS = 'timeGreaterThanOrEquals',
DATETIMELESSTHAN = 'dateTimeLessThan',
DATETIMELESSTHANOREQUALS = 'dateTimeLessThanOrEquals',
DATETIMEGREATERTHAN = 'dateTimeGreaterThan',
DATETIMEGREATERTHANOREQUALS = 'dateTimeGreaterThanOrEquals',
DAYOFWEEKEQUALS = 'dayOfWeekEquals',
DAYOFWEEKANYOF = 'dayOfWeekAnyOf',
}
}
}

/** Rule that specifies additional access granted (e.g., time-based condition) accross multiple conditions. */
export interface NestedConditionRuleWithConditions extends NestedCondition {
/** Operator to evaluate conditions. */
operator: NestedConditionRuleWithConditions.Constants.Operator | string;
/** List of conditions associated with a policy, e.g., time-based conditions that grant access over a certain
* time period.
*/
conditions: RuleAttribute[];
}
export namespace NestedConditionRuleWithConditions {
export namespace Constants {
/** Operator to evaluate conditions. */
export enum Operator {
AND = 'and',
OR = 'or',
}
}
}

/** Rule that specifies additional access granted (e.g., time-based condition). */
export interface V2PolicyRuleRuleAttribute extends V2PolicyRule {
/** The name of an attribute. */
Expand Down Expand Up @@ -3759,15 +3775,15 @@ namespace IamPolicyManagementV1 {
}

/** Rule that specifies additional access granted (e.g., time-based condition) accross multiple conditions. */
export interface V2PolicyRuleRuleWithConditions extends V2PolicyRule {
export interface V2PolicyRuleRuleWithNestedConditions extends V2PolicyRule {
/** Operator to evaluate conditions. */
operator: V2PolicyRuleRuleWithConditions.Constants.Operator | string;
operator: V2PolicyRuleRuleWithNestedConditions.Constants.Operator | string;
/** List of conditions associated with a policy, e.g., time-based conditions that grant access over a certain
* time period.
*/
conditions: RuleAttributeWithConditions[];
conditions: NestedCondition[];
}
export namespace V2PolicyRuleRuleWithConditions {
export namespace V2PolicyRuleRuleWithNestedConditions {
export namespace Constants {
/** Operator to evaluate conditions. */
export enum Operator {
Expand Down

0 comments on commit 15be7c6

Please sign in to comment.