Skip to content

Commit f53ca0e

Browse files
author
awstools
committed
feat(client-mediapackage-vod): This release adds SPEKE v2 support for MediaPackage VOD. Speke v2 is an upgrade to the existing SPEKE API to support multiple encryption keys, based on an encryption contract selected by the customer.
1 parent d89bc49 commit f53ca0e

File tree

3 files changed

+387
-118
lines changed

3 files changed

+387
-118
lines changed

clients/client-mediapackage-vod/src/models/models_0.ts

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,61 @@ export interface MssManifest {
217217
StreamSelection?: StreamSelection;
218218
}
219219

220+
export enum PresetSpeke20Audio {
221+
PRESET_AUDIO_1 = "PRESET-AUDIO-1",
222+
PRESET_AUDIO_2 = "PRESET-AUDIO-2",
223+
PRESET_AUDIO_3 = "PRESET-AUDIO-3",
224+
SHARED = "SHARED",
225+
UNENCRYPTED = "UNENCRYPTED",
226+
}
227+
228+
export enum PresetSpeke20Video {
229+
PRESET_VIDEO_1 = "PRESET-VIDEO-1",
230+
PRESET_VIDEO_2 = "PRESET-VIDEO-2",
231+
PRESET_VIDEO_3 = "PRESET-VIDEO-3",
232+
PRESET_VIDEO_4 = "PRESET-VIDEO-4",
233+
PRESET_VIDEO_5 = "PRESET-VIDEO-5",
234+
PRESET_VIDEO_6 = "PRESET-VIDEO-6",
235+
PRESET_VIDEO_7 = "PRESET-VIDEO-7",
236+
PRESET_VIDEO_8 = "PRESET-VIDEO-8",
237+
SHARED = "SHARED",
238+
UNENCRYPTED = "UNENCRYPTED",
239+
}
240+
241+
/**
242+
* Use encryptionContractConfiguration to configure one or more content encryption keys for your endpoints that use SPEKE 2.0.
243+
* The encryption contract defines which content keys are used to encrypt the audio and video tracks in your stream.
244+
* To configure the encryption contract, specify which audio and video encryption presets to use.
245+
* Note the following considerations when using encryptionContractConfiguration:
246+
* encryptionContractConfiguration can be used for DASH endpoints that use SPEKE 2.0. SPEKE 2.0 relies on the CPIX 2.3 specification.
247+
* You must disable key rotation for this endpoint by setting keyRotationIntervalSeconds to 0.
248+
*/
249+
export interface EncryptionContractConfiguration {
250+
/**
251+
* A collection of audio encryption presets.
252+
*/
253+
PresetSpeke20Audio: PresetSpeke20Audio | string | undefined;
254+
255+
/**
256+
* A collection of video encryption presets.
257+
*/
258+
PresetSpeke20Video: PresetSpeke20Video | string | undefined;
259+
}
260+
220261
/**
221262
* A configuration for accessing an external Secure Packager and Encoder Key Exchange (SPEKE) service that will provide encryption keys.
222263
*/
223264
export interface SpekeKeyProvider {
265+
/**
266+
* Use encryptionContractConfiguration to configure one or more content encryption keys for your endpoints that use SPEKE 2.0.
267+
* The encryption contract defines which content keys are used to encrypt the audio and video tracks in your stream.
268+
* To configure the encryption contract, specify which audio and video encryption presets to use.
269+
* Note the following considerations when using encryptionContractConfiguration:
270+
* encryptionContractConfiguration can be used for DASH endpoints that use SPEKE 2.0. SPEKE 2.0 relies on the CPIX 2.3 specification.
271+
* You must disable key rotation for this endpoint by setting keyRotationIntervalSeconds to 0.
272+
*/
273+
EncryptionContractConfiguration?: EncryptionContractConfiguration;
274+
224275
/**
225276
* An Amazon Resource Name (ARN) of an IAM role that AWS Elemental
226277
* MediaPackage will assume when accessing the key provider service.
@@ -1298,6 +1349,13 @@ export const MssManifestFilterSensitiveLog = (obj: MssManifest): any => ({
12981349
...obj,
12991350
});
13001351

1352+
/**
1353+
* @internal
1354+
*/
1355+
export const EncryptionContractConfigurationFilterSensitiveLog = (obj: EncryptionContractConfiguration): any => ({
1356+
...obj,
1357+
});
1358+
13011359
/**
13021360
* @internal
13031361
*/

clients/client-mediapackage-vod/src/protocols/Aws_restJson1.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ import {
7777
DashPackage,
7878
EgressAccessLogs,
7979
EgressEndpoint,
80+
EncryptionContractConfiguration,
8081
ForbiddenException,
8182
HlsEncryption,
8283
HlsManifest,
@@ -1770,6 +1771,16 @@ const serializeAws_restJson1EgressAccessLogs = (input: EgressAccessLogs, context
17701771
};
17711772
};
17721773

1774+
const serializeAws_restJson1EncryptionContractConfiguration = (
1775+
input: EncryptionContractConfiguration,
1776+
context: __SerdeContext
1777+
): any => {
1778+
return {
1779+
...(input.PresetSpeke20Audio != null && { presetSpeke20Audio: input.PresetSpeke20Audio }),
1780+
...(input.PresetSpeke20Video != null && { presetSpeke20Video: input.PresetSpeke20Video }),
1781+
};
1782+
};
1783+
17731784
const serializeAws_restJson1HlsEncryption = (input: HlsEncryption, context: __SerdeContext): any => {
17741785
return {
17751786
...(input.ConstantInitializationVector != null && {
@@ -1838,6 +1849,12 @@ const serializeAws_restJson1MssPackage = (input: MssPackage, context: __SerdeCon
18381849

18391850
const serializeAws_restJson1SpekeKeyProvider = (input: SpekeKeyProvider, context: __SerdeContext): any => {
18401851
return {
1852+
...(input.EncryptionContractConfiguration != null && {
1853+
encryptionContractConfiguration: serializeAws_restJson1EncryptionContractConfiguration(
1854+
input.EncryptionContractConfiguration,
1855+
context
1856+
),
1857+
}),
18411858
...(input.RoleArn != null && { roleArn: input.RoleArn }),
18421859
...(input.SystemIds != null && { systemIds: serializeAws_restJson1__listOf__string(input.SystemIds, context) }),
18431860
...(input.Url != null && { url: input.Url }),
@@ -2088,6 +2105,16 @@ const deserializeAws_restJson1EgressEndpoint = (output: any, context: __SerdeCon
20882105
} as any;
20892106
};
20902107

2108+
const deserializeAws_restJson1EncryptionContractConfiguration = (
2109+
output: any,
2110+
context: __SerdeContext
2111+
): EncryptionContractConfiguration => {
2112+
return {
2113+
PresetSpeke20Audio: __expectString(output.presetSpeke20Audio),
2114+
PresetSpeke20Video: __expectString(output.presetSpeke20Video),
2115+
} as any;
2116+
};
2117+
20912118
const deserializeAws_restJson1HlsEncryption = (output: any, context: __SerdeContext): HlsEncryption => {
20922119
return {
20932120
ConstantInitializationVector: __expectString(output.constantInitializationVector),
@@ -2193,6 +2220,10 @@ const deserializeAws_restJson1PackagingGroup = (output: any, context: __SerdeCon
21932220

21942221
const deserializeAws_restJson1SpekeKeyProvider = (output: any, context: __SerdeContext): SpekeKeyProvider => {
21952222
return {
2223+
EncryptionContractConfiguration:
2224+
output.encryptionContractConfiguration != null
2225+
? deserializeAws_restJson1EncryptionContractConfiguration(output.encryptionContractConfiguration, context)
2226+
: undefined,
21962227
RoleArn: __expectString(output.roleArn),
21972228
SystemIds:
21982229
output.systemIds != null ? deserializeAws_restJson1__listOf__string(output.systemIds, context) : undefined,

0 commit comments

Comments
 (0)