Skip to content

Commit 5d254af

Browse files
author
awstools
committed
feat(client-workspaces): This release introduces ModifySamlProperties, a new API that allows control of SAML properties associated with a WorkSpaces directory. The DescribeWorkspaceDirectories API will now additionally return SAML properties in its responses.
1 parent 8630419 commit 5d254af

File tree

8 files changed

+529
-1
lines changed

8 files changed

+529
-1
lines changed

clients/client-workspaces/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ try {
182182
const data = await client.send(command);
183183
// process data.
184184
} catch (error) {
185-
const { requestId, cfId, extendedRequestId } = error.$metadata;
185+
const { requestId, cfId, extendedRequestId } = error.$$metadata;
186186
console.log({ requestId, cfId, extendedRequestId });
187187
/**
188188
* The keys within exceptions are also parsed.

clients/client-workspaces/src/WorkSpaces.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,11 @@ import {
213213
ModifyClientPropertiesCommandInput,
214214
ModifyClientPropertiesCommandOutput,
215215
} from "./commands/ModifyClientPropertiesCommand";
216+
import {
217+
ModifySamlPropertiesCommand,
218+
ModifySamlPropertiesCommandInput,
219+
ModifySamlPropertiesCommandOutput,
220+
} from "./commands/ModifySamlPropertiesCommand";
216221
import {
217222
ModifySelfservicePermissionsCommand,
218223
ModifySelfservicePermissionsCommandInput,
@@ -1885,6 +1890,40 @@ export class WorkSpaces extends WorkSpacesClient {
18851890
}
18861891
}
18871892

1893+
/**
1894+
* <p>Modifies multiple properties related to SAML 2.0 authentication, including the enablement status,
1895+
* user access URL, and relay state parameter name that are used for configuring federation with an
1896+
* SAML 2.0 identity provider.</p>
1897+
*/
1898+
public modifySamlProperties(
1899+
args: ModifySamlPropertiesCommandInput,
1900+
options?: __HttpHandlerOptions
1901+
): Promise<ModifySamlPropertiesCommandOutput>;
1902+
public modifySamlProperties(
1903+
args: ModifySamlPropertiesCommandInput,
1904+
cb: (err: any, data?: ModifySamlPropertiesCommandOutput) => void
1905+
): void;
1906+
public modifySamlProperties(
1907+
args: ModifySamlPropertiesCommandInput,
1908+
options: __HttpHandlerOptions,
1909+
cb: (err: any, data?: ModifySamlPropertiesCommandOutput) => void
1910+
): void;
1911+
public modifySamlProperties(
1912+
args: ModifySamlPropertiesCommandInput,
1913+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ModifySamlPropertiesCommandOutput) => void),
1914+
cb?: (err: any, data?: ModifySamlPropertiesCommandOutput) => void
1915+
): Promise<ModifySamlPropertiesCommandOutput> | void {
1916+
const command = new ModifySamlPropertiesCommand(args);
1917+
if (typeof optionsOrCb === "function") {
1918+
this.send(command, optionsOrCb);
1919+
} else if (typeof cb === "function") {
1920+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1921+
this.send(command, optionsOrCb || {}, cb);
1922+
} else {
1923+
return this.send(command, optionsOrCb);
1924+
}
1925+
}
1926+
18881927
/**
18891928
* <p>Modifies the self-service WorkSpace management capabilities for your users. For more
18901929
* information, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/enable-user-self-service-workspace-management.html">Enable Self-Service WorkSpace Management Capabilities for Your Users</a>.</p>

clients/client-workspaces/src/WorkSpacesClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ import {
187187
ModifyClientPropertiesCommandInput,
188188
ModifyClientPropertiesCommandOutput,
189189
} from "./commands/ModifyClientPropertiesCommand";
190+
import {
191+
ModifySamlPropertiesCommandInput,
192+
ModifySamlPropertiesCommandOutput,
193+
} from "./commands/ModifySamlPropertiesCommand";
190194
import {
191195
ModifySelfservicePermissionsCommandInput,
192196
ModifySelfservicePermissionsCommandOutput,
@@ -288,6 +292,7 @@ export type ServiceInputTypes =
288292
| MigrateWorkspaceCommandInput
289293
| ModifyAccountCommandInput
290294
| ModifyClientPropertiesCommandInput
295+
| ModifySamlPropertiesCommandInput
291296
| ModifySelfservicePermissionsCommandInput
292297
| ModifyWorkspaceAccessPropertiesCommandInput
293298
| ModifyWorkspaceCreationPropertiesCommandInput
@@ -352,6 +357,7 @@ export type ServiceOutputTypes =
352357
| MigrateWorkspaceCommandOutput
353358
| ModifyAccountCommandOutput
354359
| ModifyClientPropertiesCommandOutput
360+
| ModifySamlPropertiesCommandOutput
355361
| ModifySelfservicePermissionsCommandOutput
356362
| ModifyWorkspaceAccessPropertiesCommandOutput
357363
| ModifyWorkspaceCreationPropertiesCommandOutput
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
// smithy-typescript generated code
2+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
4+
import { Command as $Command } from "@aws-sdk/smithy-client";
5+
import {
6+
FinalizeHandlerArguments,
7+
Handler,
8+
HandlerExecutionContext,
9+
HttpHandlerOptions as __HttpHandlerOptions,
10+
MetadataBearer as __MetadataBearer,
11+
MiddlewareStack,
12+
SerdeContext as __SerdeContext,
13+
} from "@aws-sdk/types";
14+
15+
import {
16+
ModifySamlPropertiesRequest,
17+
ModifySamlPropertiesRequestFilterSensitiveLog,
18+
ModifySamlPropertiesResult,
19+
ModifySamlPropertiesResultFilterSensitiveLog,
20+
} from "../models/models_0";
21+
import {
22+
deserializeAws_json1_1ModifySamlPropertiesCommand,
23+
serializeAws_json1_1ModifySamlPropertiesCommand,
24+
} from "../protocols/Aws_json1_1";
25+
import { ServiceInputTypes, ServiceOutputTypes, WorkSpacesClientResolvedConfig } from "../WorkSpacesClient";
26+
27+
export interface ModifySamlPropertiesCommandInput extends ModifySamlPropertiesRequest {}
28+
export interface ModifySamlPropertiesCommandOutput extends ModifySamlPropertiesResult, __MetadataBearer {}
29+
30+
/**
31+
* <p>Modifies multiple properties related to SAML 2.0 authentication, including the enablement status,
32+
* user access URL, and relay state parameter name that are used for configuring federation with an
33+
* SAML 2.0 identity provider.</p>
34+
* @example
35+
* Use a bare-bones client and the command you need to make an API call.
36+
* ```javascript
37+
* import { WorkSpacesClient, ModifySamlPropertiesCommand } from "@aws-sdk/client-workspaces"; // ES Modules import
38+
* // const { WorkSpacesClient, ModifySamlPropertiesCommand } = require("@aws-sdk/client-workspaces"); // CommonJS import
39+
* const client = new WorkSpacesClient(config);
40+
* const command = new ModifySamlPropertiesCommand(input);
41+
* const response = await client.send(command);
42+
* ```
43+
*
44+
* @see {@link ModifySamlPropertiesCommandInput} for command's `input` shape.
45+
* @see {@link ModifySamlPropertiesCommandOutput} for command's `response` shape.
46+
* @see {@link WorkSpacesClientResolvedConfig | config} for WorkSpacesClient's `config` shape.
47+
*
48+
*/
49+
export class ModifySamlPropertiesCommand extends $Command<
50+
ModifySamlPropertiesCommandInput,
51+
ModifySamlPropertiesCommandOutput,
52+
WorkSpacesClientResolvedConfig
53+
> {
54+
// Start section: command_properties
55+
// End section: command_properties
56+
57+
constructor(readonly input: ModifySamlPropertiesCommandInput) {
58+
// Start section: command_constructor
59+
super();
60+
// End section: command_constructor
61+
}
62+
63+
/**
64+
* @internal
65+
*/
66+
resolveMiddleware(
67+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
68+
configuration: WorkSpacesClientResolvedConfig,
69+
options?: __HttpHandlerOptions
70+
): Handler<ModifySamlPropertiesCommandInput, ModifySamlPropertiesCommandOutput> {
71+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
72+
73+
const stack = clientStack.concat(this.middlewareStack);
74+
75+
const { logger } = configuration;
76+
const clientName = "WorkSpacesClient";
77+
const commandName = "ModifySamlPropertiesCommand";
78+
const handlerExecutionContext: HandlerExecutionContext = {
79+
logger,
80+
clientName,
81+
commandName,
82+
inputFilterSensitiveLog: ModifySamlPropertiesRequestFilterSensitiveLog,
83+
outputFilterSensitiveLog: ModifySamlPropertiesResultFilterSensitiveLog,
84+
};
85+
const { requestHandler } = configuration;
86+
return stack.resolve(
87+
(request: FinalizeHandlerArguments<any>) =>
88+
requestHandler.handle(request.request as __HttpRequest, options || {}),
89+
handlerExecutionContext
90+
);
91+
}
92+
93+
private serialize(input: ModifySamlPropertiesCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
94+
return serializeAws_json1_1ModifySamlPropertiesCommand(input, context);
95+
}
96+
97+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<ModifySamlPropertiesCommandOutput> {
98+
return deserializeAws_json1_1ModifySamlPropertiesCommand(output, context);
99+
}
100+
101+
// Start section: command_body_extra
102+
// End section: command_body_extra
103+
}

clients/client-workspaces/src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export * from "./ListAvailableManagementCidrRangesCommand";
4343
export * from "./MigrateWorkspaceCommand";
4444
export * from "./ModifyAccountCommand";
4545
export * from "./ModifyClientPropertiesCommand";
46+
export * from "./ModifySamlPropertiesCommand";
4647
export * from "./ModifySelfservicePermissionsCommand";
4748
export * from "./ModifyWorkspaceAccessPropertiesCommand";
4849
export * from "./ModifyWorkspaceCreationPropertiesCommand";

clients/client-workspaces/src/models/models_0.ts

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,6 +1373,11 @@ export interface DefaultWorkspaceCreationProperties {
13731373
EnableMaintenanceMode?: boolean;
13741374
}
13751375

1376+
export enum DeletableSamlProperty {
1377+
SAML_PROPERTIES_RELAY_STATE_PARAMETER_NAME = "SAML_PROPERTIES_RELAY_STATE_PARAMETER_NAME",
1378+
SAML_PROPERTIES_USER_ACCESS_URL = "SAML_PROPERTIES_USER_ACCESS_URL",
1379+
}
1380+
13761381
export interface DeleteClientBrandingRequest {
13771382
/**
13781383
* <p>The directory identifier of the WorkSpace for which you want to delete client
@@ -1879,6 +1884,55 @@ export enum WorkspaceDirectoryType {
18791884
SIMPLE_AD = "SIMPLE_AD",
18801885
}
18811886

1887+
export enum SamlStatusEnum {
1888+
DISABLED = "DISABLED",
1889+
ENABLED = "ENABLED",
1890+
ENABLED_WITH_DIRECTORY_LOGIN_FALLBACK = "ENABLED_WITH_DIRECTORY_LOGIN_FALLBACK",
1891+
}
1892+
1893+
/**
1894+
* <p>Describes the enablement status, user access URL, and relay state parameter name that
1895+
* are used for configuring federation with an SAML 2.0 identity provider.</p>
1896+
*/
1897+
export interface SamlProperties {
1898+
/**
1899+
* <p>Indicates the status of SAML 2.0 authentication. These statuses include the following.</p>
1900+
* <ul>
1901+
* <li>
1902+
* <p>If the setting is <code>DISABLED</code>, end users will be directed to login with their directory credentials.</p>
1903+
* </li>
1904+
* <li>
1905+
* <p>If the setting is <code>ENABLED</code>, end users will be directed to login via the user access URL. Users attempting
1906+
* to connect to WorkSpaces from a client application that does not support SAML 2.0 authentication will not be able to
1907+
* connect.</p>
1908+
* </li>
1909+
* <li>
1910+
* <p>If the setting is <code>ENABLED_WITH_DIRECTORY_LOGIN_FALLBACK</code>, end users will be directed to login via the user
1911+
* access URL on supported client applications, but will not prevent clients that do not support SAML 2.0 authentication
1912+
* from connecting as if SAML 2.0 authentication was disabled.</p>
1913+
* </li>
1914+
* </ul>
1915+
*/
1916+
Status?: SamlStatusEnum | string;
1917+
1918+
/**
1919+
* <p>The SAML 2.0 identity provider (IdP) user access URL is the URL a user would navigate to in their web browser in
1920+
* order to federate from the IdP and directly access the application, without any SAML 2.0 service provider (SP)
1921+
* bindings.</p>
1922+
*/
1923+
UserAccessUrl?: string;
1924+
1925+
/**
1926+
* <p>The relay state parameter name supported by the SAML 2.0 identity provider (IdP). When the end user is redirected to
1927+
* the user access URL from the WorkSpaces client application, this relay state parameter name is appended as a query
1928+
* parameter to the URL along with the relay state endpoint to return the user to the client application session.</p>
1929+
*
1930+
* <p>To use SAML 2.0 authentication with WorkSpaces, the IdP must support IdP-initiated deep linking for the relay state
1931+
* URL. Consult your IdP documentation for more information.</p>
1932+
*/
1933+
RelayStateParameterName?: string;
1934+
}
1935+
18821936
/**
18831937
* <p>Describes the self-service permissions for a directory. For more information, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/enable-user-self-service-workspace-management.html">Enable Self-Service WorkSpace Management Capabilities for Your Users</a>.</p>
18841938
*/
@@ -2064,6 +2118,12 @@ export interface WorkspaceDirectory {
20642118
* <p>The default self-service permissions for WorkSpaces in the directory.</p>
20652119
*/
20662120
SelfservicePermissions?: SelfservicePermissions;
2121+
2122+
/**
2123+
* <p>Describes the enablement status, user access URL, and relay state parameter name that are used for configuring
2124+
* federation with an SAML 2.0 identity provider.</p>
2125+
*/
2126+
SamlProperties?: SamlProperties;
20672127
}
20682128

20692129
export interface DescribeWorkspaceDirectoriesResult {
@@ -2764,6 +2824,37 @@ export interface ModifyClientPropertiesRequest {
27642824

27652825
export interface ModifyClientPropertiesResult {}
27662826

2827+
export interface ModifySamlPropertiesRequest {
2828+
/**
2829+
* <p>The directory identifier for which you want to configure SAML properties.</p>
2830+
*/
2831+
ResourceId: string | undefined;
2832+
2833+
/**
2834+
* <p>The properties for configuring SAML 2.0 authentication.</p>
2835+
*/
2836+
SamlProperties?: SamlProperties;
2837+
2838+
/**
2839+
* <p>The SAML properties to delete as part of your request.</p>
2840+
* <p>Specify one of the following options:</p>
2841+
* <ul>
2842+
* <li>
2843+
* <p>
2844+
* <code>SAML_PROPERTIES_USER_ACCESS_URL</code> to delete the user access URL.</p>
2845+
* </li>
2846+
* <li>
2847+
* <p>
2848+
* <code>SAML_PROPERTIES_RELAY_STATE_PARAMETER_NAME</code> to delete the
2849+
* relay state parameter name.</p>
2850+
* </li>
2851+
* </ul>
2852+
*/
2853+
PropertiesToDelete?: (DeletableSamlProperty | string)[];
2854+
}
2855+
2856+
export interface ModifySamlPropertiesResult {}
2857+
27672858
export interface ModifySelfservicePermissionsRequest {
27682859
/**
27692860
* <p>The identifier of the directory.</p>
@@ -3859,6 +3950,13 @@ export const DescribeWorkspaceDirectoriesRequestFilterSensitiveLog = (
38593950
...obj,
38603951
});
38613952

3953+
/**
3954+
* @internal
3955+
*/
3956+
export const SamlPropertiesFilterSensitiveLog = (obj: SamlProperties): any => ({
3957+
...obj,
3958+
});
3959+
38623960
/**
38633961
* @internal
38643962
*/
@@ -4130,6 +4228,20 @@ export const ModifyClientPropertiesResultFilterSensitiveLog = (obj: ModifyClient
41304228
...obj,
41314229
});
41324230

4231+
/**
4232+
* @internal
4233+
*/
4234+
export const ModifySamlPropertiesRequestFilterSensitiveLog = (obj: ModifySamlPropertiesRequest): any => ({
4235+
...obj,
4236+
});
4237+
4238+
/**
4239+
* @internal
4240+
*/
4241+
export const ModifySamlPropertiesResultFilterSensitiveLog = (obj: ModifySamlPropertiesResult): any => ({
4242+
...obj,
4243+
});
4244+
41334245
/**
41344246
* @internal
41354247
*/

0 commit comments

Comments
 (0)