Skip to content

Commit 31dd3bc

Browse files
authored
feat: Support external_key_id (EKM) on projects (#142)
1 parent 3d2d505 commit 31dd3bc

File tree

14 files changed

+87
-21
lines changed

14 files changed

+87
-21
lines changed

docs/data-sources/project.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ data "openai_project" "example" {
2929

3030
- `archived_at` (Number) The Unix timestamp (in seconds) of when the project was archived or `null`.
3131
- `created_at` (Number) The Unix timestamp (in seconds) of when the project was created.
32+
- `external_key_id` (String) The ID of the customer-managed encryption key used for Enterprise Key Management (EKM). EKM is only available on certain accounts. Refer to the [EKM (External Keys) in the Management API Article](https://help.openai.com/en/articles/20000953-ekm-external-keys-in-the-management-api).
3233
- `name` (String) The name of the project. This appears in reporting.
3334
- `status` (String) Status `active` or `archived`.

docs/data-sources/projects.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Read-Only:
3636

3737
- `archived_at` (Number) The Unix timestamp (in seconds) of when the project was archived or `null`.
3838
- `created_at` (Number) The Unix timestamp (in seconds) of when the project was created.
39+
- `external_key_id` (String) The ID of the customer-managed encryption key used for Enterprise Key Management (EKM). EKM is only available on certain accounts. Refer to the [EKM (External Keys) in the Management API Article](https://help.openai.com/en/articles/20000953-ekm-external-keys-in-the-management-api).
3940
- `id` (String) Project ID.
4041
- `name` (String) The name of the project. This appears in reporting.
4142
- `status` (String) Status `active` or `archived`.

docs/resources/project.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ resource "openai_project" "example" {
2525

2626
- `name` (String) The friendly name of the project, this name appears in reports.
2727

28+
### Optional
29+
30+
- `external_key_id` (String) The ID of the customer-managed encryption key to use for Enterprise Key Management (EKM). EKM is only available on certain accounts. Refer to the [EKM (External Keys) in the Management API Article](https://help.openai.com/en/articles/20000953-ekm-external-keys-in-the-management-api).
31+
2832
### Read-Only
2933

3034
- `archived_at` (Number) The Unix timestamp (in seconds) of when the project was archived or `null`.

internal/apiclient/api-original.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41621,13 +41621,12 @@ components:
4162141621
- type
4162241622
- input_audio
4162341623
InputContent:
41624+
discriminator:
41625+
propertyName: type
4162441626
anyOf:
4162541627
- $ref: '#/components/schemas/InputTextContent'
4162641628
- $ref: '#/components/schemas/InputImageContent'
4162741629
- $ref: '#/components/schemas/InputFileContent'
41628-
- $ref: '#/components/schemas/InputAudio'
41629-
discriminator:
41630-
propertyName: type
4163141630
InputItem:
4163241631
discriminator:
4163341632
propertyName: type
@@ -61818,6 +61817,8 @@ components:
6181861817
type: object
6181961818
required:
6182061819
- type
61820+
title: Local shell tool
61821+
description: A tool that allows the model to execute shell commands in a local environment.
6182161822
CustomTextFormatParam:
6182261823
properties:
6182361824
type:
@@ -61881,6 +61882,10 @@ components:
6188161882
required:
6188261883
- type
6188361884
- name
61885+
title: Custom tool
61886+
description: >-
61887+
A custom tool that processes input using a specified format. Learn more about [custom
61888+
tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
6188461889
ApproximateLocation:
6188561890
properties:
6188661891
type:

internal/apiclient/api.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9401,6 +9401,8 @@ components:
94019401
title: Custom tool
94029402
type: object
94039403
CustomToolParam:
9404+
description: A custom tool that processes input using a specified format. Learn
9405+
more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
94049406
properties:
94059407
description:
94069408
description: Optional description of the custom tool, used to provide more
@@ -9427,6 +9429,7 @@ components:
94279429
required:
94289430
- type
94299431
- name
9432+
title: Custom tool
94309433
type: object
94319434
DeleteAssistantResponse:
94329435
properties:
@@ -13617,7 +13620,6 @@ components:
1361713620
- $ref: '#/components/schemas/InputTextContent'
1361813621
- $ref: '#/components/schemas/InputImageContent'
1361913622
- $ref: '#/components/schemas/InputFileContent'
13620-
- $ref: '#/components/schemas/InputAudio'
1362113623
discriminator:
1362213624
propertyName: type
1362313625
InputFidelity:
@@ -14637,6 +14639,8 @@ components:
1463714639
title: Local shell call output
1463814640
type: object
1463914641
LocalShellToolParam:
14642+
description: A tool that allows the model to execute shell commands in a local
14643+
environment.
1464014644
properties:
1464114645
type:
1464214646
default: local_shell
@@ -14647,6 +14651,7 @@ components:
1464714651
x-stainless-const: true
1464814652
required:
1464914653
- type
14654+
title: Local shell tool
1465014655
type: object
1465114656
LockedStatus:
1465214657
description: Indicates that a thread is locked and cannot accept new input.
@@ -16643,6 +16648,10 @@ components:
1664316648
description: The Unix timestamp (in seconds) of when the project was created.
1664416649
format: int64
1664516650
type: integer
16651+
external_key_id: &id001
16652+
description: The ID of the customer-managed encryption key for Enterprise
16653+
Key Management (EKM).
16654+
type: string
1664616655
id:
1664716656
description: The identifier, which can be referenced in API endpoints
1664816657
type: string
@@ -16774,6 +16783,7 @@ components:
1677416783
type: object
1677516784
ProjectCreateRequest:
1677616785
properties:
16786+
external_key_id: *id001
1677716787
geography:
1677816788
description: Create the project with the specified data residency region.
1677916789
Your organization must have access to Data residency functionality in

internal/apiclient/apiclient.gen.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/apiclient/main.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,29 @@ def fix_response_status_code(spec):
9797
return spec
9898

9999

100+
def add_external_key_id_to_project(spec):
101+
property_spec = {
102+
"type": "string",
103+
"description": "The ID of the customer-managed encryption key for Enterprise Key Management (EKM).",
104+
}
105+
spec["components"]["schemas"]["Project"]["properties"][
106+
"external_key_id"
107+
] = property_spec
108+
spec["components"]["schemas"]["ProjectCreateRequest"]["properties"][
109+
"external_key_id"
110+
] = property_spec
111+
112+
return spec
113+
114+
100115
fix_funcs = [
101116
fix_openapi_version,
102117
fix_remove_non_administrative_endpoints,
103118
fix_certificate_id_parameter,
104119
fix_any_of,
105120
fix_number_format,
106121
fix_response_status_code,
122+
add_external_key_id_to_project,
107123
]
108124

109125

internal/provider/data_source_project.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ func (d *ProjectDataSource) Schema(ctx context.Context, req datasource.SchemaReq
4040
MarkdownDescription: "Status `active` or `archived`.",
4141
Computed: true,
4242
},
43+
"external_key_id": schema.StringAttribute{
44+
MarkdownDescription: "The ID of the customer-managed encryption key used for Enterprise Key Management (EKM). EKM is only available on certain accounts. Refer to the [EKM (External Keys) in the Management API Article](https://help.openai.com/en/articles/20000953-ekm-external-keys-in-the-management-api).",
45+
Computed: true,
46+
},
4347
"created_at": schema.Int64Attribute{
4448
MarkdownDescription: "The Unix timestamp (in seconds) of when the project was created.",
4549
Computed: true,

internal/provider/data_source_project_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ func TestAccProjectDataSource(t *testing.T) {
2525
statecheck.ExpectKnownValue(rn, tfjsonpath.New("id"), knownvalue.NotNull()),
2626
statecheck.ExpectKnownValue(rn, tfjsonpath.New("name"), knownvalue.StringExact(projectName)),
2727
statecheck.ExpectKnownValue(rn, tfjsonpath.New("status"), knownvalue.StringExact("active")),
28+
statecheck.ExpectKnownValue(rn, tfjsonpath.New("external_key_id"), knownvalue.Null()),
2829
statecheck.ExpectKnownValue(rn, tfjsonpath.New("created_at"), knownvalue.NotNull()),
2930
statecheck.ExpectKnownValue(rn, tfjsonpath.New("archived_at"), knownvalue.Null()),
3031
},

internal/provider/data_source_projects.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ func (d *ProjectsDataSource) Schema(ctx context.Context, req datasource.SchemaRe
7979
MarkdownDescription: "Status `active` or `archived`.",
8080
Computed: true,
8181
},
82+
"external_key_id": schema.StringAttribute{
83+
MarkdownDescription: "The ID of the customer-managed encryption key used for Enterprise Key Management (EKM). EKM is only available on certain accounts. Refer to the [EKM (External Keys) in the Management API Article](https://help.openai.com/en/articles/20000953-ekm-external-keys-in-the-management-api).",
84+
Computed: true,
85+
},
8286
"created_at": schema.Int64Attribute{
8387
MarkdownDescription: "The Unix timestamp (in seconds) of when the project was created.",
8488
Computed: true,

0 commit comments

Comments
 (0)