Skip to content

Add SAML attributes #1445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2023-12-20 13:53:02.907433",
"spec_repo_commit": "1e75e401"
"regenerated": "2023-12-20 18:12:33.560780",
"spec_repo_commit": "0ea19912"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2023-12-20 13:53:02.922929",
"spec_repo_commit": "1e75e401"
"regenerated": "2023-12-20 18:12:33.577115",
"spec_repo_commit": "0ea19912"
}
}
}
46 changes: 46 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13640,6 +13640,27 @@ components:
- id
- type
type: object
RelationshipToUserTeamTeam:
description: Relationship between team membership and team
properties:
data:
$ref: '#/components/schemas/RelationshipToUserTeamTeamData'
required:
- data
type: object
RelationshipToUserTeamTeamData:
description: The team associated with the membership
properties:
id:
description: The ID of the team associated with the membership
example: d7e15d9d-d346-43da-81d8-3d9e71d9a5e9
type: string
type:
$ref: '#/components/schemas/UserTeamTeamType'
required:
- id
- type
type: object
RelationshipToUserTeamUser:
description: Relationship between team membership and user
properties:
Expand Down Expand Up @@ -19614,6 +19635,20 @@ components:
UserTeamAttributes:
description: Team membership attributes
properties:
provisioned_by:
description: 'The mechanism responsible for provisioning the team relationship.

Possible values: null for added by a user, "service_account" if added
by a service account, and "saml_mapping" if provisioned via SAML mapping.'
nullable: true
readOnly: true
type: string
provisioned_by_id:
description: UUID of the User or Service Account who provisioned this team
membership, or null if provisioned via SAML mapping.
nullable: true
readOnly: true
type: string
role:
$ref: '#/components/schemas/UserTeamRole'
type: object
Expand Down Expand Up @@ -19665,6 +19700,8 @@ components:
UserTeamRelationships:
description: Relationship between membership and a user
properties:
team:
$ref: '#/components/schemas/RelationshipToUserTeamTeam'
user:
$ref: '#/components/schemas/RelationshipToUserTeamUser'
type: object
Expand All @@ -19690,6 +19727,15 @@ components:
type: string
x-enum-varnames:
- ADMIN
UserTeamTeamType:
default: team
description: User team team type
enum:
- team
example: team
type: string
x-enum-varnames:
- TEAM
UserTeamType:
default: team_memberships
description: Team membership type
Expand Down
6 changes: 6 additions & 0 deletions examples/v2/teams/CreateTeamMembership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ const params: v2.TeamsApiCreateTeamMembershipRequest = {
role: "admin",
},
relationships: {
team: {
data: {
id: "d7e15d9d-d346-43da-81d8-3d9e71d9a5e9",
type: "team",
},
},
user: {
data: {
id: "b8626d7e-cedd-11eb-abf5-da7ad0900001",
Expand Down
4 changes: 2 additions & 2 deletions features/v2/teams.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ Feature: Teams
Scenario: Add a user to a team returns "API error response." response
Given new "CreateTeamMembership" request
And request contains "team_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"role": "admin"}, "relationships": {"user": {"data": {"id": "b8626d7e-cedd-11eb-abf5-da7ad0900001", "type": "users"}}}, "type": "team_memberships"}}
And body with value {"data": {"attributes": {"role": "admin"}, "relationships": {"team": {"data": {"id": "d7e15d9d-d346-43da-81d8-3d9e71d9a5e9", "type": "team"}}, "user": {"data": {"id": "b8626d7e-cedd-11eb-abf5-da7ad0900001", "type": "users"}}}, "type": "team_memberships"}}
When the request is sent
Then the response status is 409 API error response.

@generated @skip @team:DataDog/core-app
Scenario: Add a user to a team returns "Represents a user's association to a team" response
Given new "CreateTeamMembership" request
And request contains "team_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"role": "admin"}, "relationships": {"user": {"data": {"id": "b8626d7e-cedd-11eb-abf5-da7ad0900001", "type": "users"}}}, "type": "team_memberships"}}
And body with value {"data": {"attributes": {"role": "admin"}, "relationships": {"team": {"data": {"id": "d7e15d9d-d346-43da-81d8-3d9e71d9a5e9", "type": "team"}}, "user": {"data": {"id": "b8626d7e-cedd-11eb-abf5-da7ad0900001", "type": "users"}}}, "type": "team_memberships"}}
When the request is sent
Then the response status is 200 Represents a user's association to a team

Expand Down
3 changes: 3 additions & 0 deletions packages/datadog-api-client-v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,8 @@ export { RelationshipToUserData } from "./models/RelationshipToUserData";
export { RelationshipToUsers } from "./models/RelationshipToUsers";
export { RelationshipToUserTeamPermission } from "./models/RelationshipToUserTeamPermission";
export { RelationshipToUserTeamPermissionData } from "./models/RelationshipToUserTeamPermissionData";
export { RelationshipToUserTeamTeam } from "./models/RelationshipToUserTeamTeam";
export { RelationshipToUserTeamTeamData } from "./models/RelationshipToUserTeamTeamData";
export { RelationshipToUserTeamUser } from "./models/RelationshipToUserTeamUser";
export { RelationshipToUserTeamUserData } from "./models/RelationshipToUserTeamUserData";
export { ReorderRetentionFiltersRequest } from "./models/ReorderRetentionFiltersRequest";
Expand Down Expand Up @@ -1696,6 +1698,7 @@ export { UserTeamRequest } from "./models/UserTeamRequest";
export { UserTeamResponse } from "./models/UserTeamResponse";
export { UserTeamRole } from "./models/UserTeamRole";
export { UserTeamsResponse } from "./models/UserTeamsResponse";
export { UserTeamTeamType } from "./models/UserTeamTeamType";
export { UserTeamType } from "./models/UserTeamType";
export { UserTeamUpdate } from "./models/UserTeamUpdate";
export { UserTeamUpdateRequest } from "./models/UserTeamUpdateRequest";
Expand Down
5 changes: 5 additions & 0 deletions packages/datadog-api-client-v2/models/ObjectSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,8 @@ import { RelationshipToUser } from "./RelationshipToUser";
import { RelationshipToUserData } from "./RelationshipToUserData";
import { RelationshipToUserTeamPermission } from "./RelationshipToUserTeamPermission";
import { RelationshipToUserTeamPermissionData } from "./RelationshipToUserTeamPermissionData";
import { RelationshipToUserTeamTeam } from "./RelationshipToUserTeamTeam";
import { RelationshipToUserTeamTeamData } from "./RelationshipToUserTeamTeamData";
import { RelationshipToUserTeamUser } from "./RelationshipToUserTeamUser";
import { RelationshipToUserTeamUserData } from "./RelationshipToUserTeamUserData";
import { RelationshipToUsers } from "./RelationshipToUsers";
Expand Down Expand Up @@ -1504,6 +1506,7 @@ const enumsMap: { [key: string]: any[] } = {
UserInvitationsType: ["user_invitations"],
UserTeamPermissionType: ["user_team_permissions"],
UserTeamRole: ["admin"],
UserTeamTeamType: ["team"],
UserTeamType: ["team_memberships"],
UserTeamUserType: ["users"],
UsersType: ["users"],
Expand Down Expand Up @@ -2242,6 +2245,8 @@ const typeMap: { [index: string]: any } = {
RelationshipToUserData: RelationshipToUserData,
RelationshipToUserTeamPermission: RelationshipToUserTeamPermission,
RelationshipToUserTeamPermissionData: RelationshipToUserTeamPermissionData,
RelationshipToUserTeamTeam: RelationshipToUserTeamTeam,
RelationshipToUserTeamTeamData: RelationshipToUserTeamTeamData,
RelationshipToUserTeamUser: RelationshipToUserTeamUser,
RelationshipToUserTeamUserData: RelationshipToUserTeamUserData,
RelationshipToUsers: RelationshipToUsers,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2020-Present Datadog, Inc.
*/
import { RelationshipToUserTeamTeamData } from "./RelationshipToUserTeamTeamData";

import { AttributeTypeMap } from "../../datadog-api-client-common/util";

/**
* Relationship between team membership and team
*/
export class RelationshipToUserTeamTeam {
/**
* The team associated with the membership
*/
"data": RelationshipToUserTeamTeamData;

/**
* @ignore
*/
"_unparsed"?: boolean;

/**
* @ignore
*/
static readonly attributeTypeMap: AttributeTypeMap = {
data: {
baseName: "data",
type: "RelationshipToUserTeamTeamData",
required: true,
},
};

/**
* @ignore
*/
static getAttributeTypeMap(): AttributeTypeMap {
return RelationshipToUserTeamTeam.attributeTypeMap;
}

public constructor() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2020-Present Datadog, Inc.
*/
import { UserTeamTeamType } from "./UserTeamTeamType";

import { AttributeTypeMap } from "../../datadog-api-client-common/util";

/**
* The team associated with the membership
*/
export class RelationshipToUserTeamTeamData {
/**
* The ID of the team associated with the membership
*/
"id": string;
/**
* User team team type
*/
"type": UserTeamTeamType;

/**
* @ignore
*/
"_unparsed"?: boolean;

/**
* @ignore
*/
static readonly attributeTypeMap: AttributeTypeMap = {
id: {
baseName: "id",
type: "string",
required: true,
},
type: {
baseName: "type",
type: "UserTeamTeamType",
required: true,
},
};

/**
* @ignore
*/
static getAttributeTypeMap(): AttributeTypeMap {
return RelationshipToUserTeamTeamData.attributeTypeMap;
}

public constructor() {}
}
17 changes: 17 additions & 0 deletions packages/datadog-api-client-v2/models/UserTeamAttributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
* Team membership attributes
*/
export class UserTeamAttributes {
/**
* The mechanism responsible for provisioning the team relationship.
* Possible values: null for added by a user, "service_account" if added by a service account, and "saml_mapping" if provisioned via SAML mapping.
*/
"provisionedBy"?: string;
/**
* UUID of the User or Service Account who provisioned this team membership, or null if provisioned via SAML mapping.
*/
"provisionedById"?: string;
/**
* The user's role within the team
*/
Expand All @@ -25,6 +34,14 @@ export class UserTeamAttributes {
* @ignore
*/
static readonly attributeTypeMap: AttributeTypeMap = {
provisionedBy: {
baseName: "provisioned_by",
type: "string",
},
provisionedById: {
baseName: "provisioned_by_id",
type: "string",
},
role: {
baseName: "role",
type: "UserTeamRole",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2020-Present Datadog, Inc.
*/
import { RelationshipToUserTeamTeam } from "./RelationshipToUserTeamTeam";
import { RelationshipToUserTeamUser } from "./RelationshipToUserTeamUser";

import { AttributeTypeMap } from "../../datadog-api-client-common/util";
Expand All @@ -11,6 +12,10 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
* Relationship between membership and a user
*/
export class UserTeamRelationships {
/**
* Relationship between team membership and team
*/
"team"?: RelationshipToUserTeamTeam;
/**
* Relationship between team membership and user
*/
Expand All @@ -25,6 +30,10 @@ export class UserTeamRelationships {
* @ignore
*/
static readonly attributeTypeMap: AttributeTypeMap = {
team: {
baseName: "team",
type: "RelationshipToUserTeamTeam",
},
user: {
baseName: "user",
type: "RelationshipToUserTeamUser",
Expand Down
14 changes: 14 additions & 0 deletions packages/datadog-api-client-v2/models/UserTeamTeamType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2020-Present Datadog, Inc.
*/

import { UnparsedObject } from "../../datadog-api-client-common/util";

/**
* User team team type
*/

export type UserTeamTeamType = typeof TEAM | UnparsedObject;
export const TEAM = "team";