Skip to content

Commit 371f8f7

Browse files
feat(api): add scope field and enum to environment secrets
1 parent 110c2ef commit 371f8f7

4 files changed

Lines changed: 34 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 172
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-912e6f9f02b4b4e145bd8c12e8ea65422246fb626abedb150c9791065d9407c1.yml
3-
openapi_spec_hash: e1ffa39323c616de827752550560ee7c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-e086ada0c2b3511c0c38525a98751d806ba816a451b62f7f9c2265862c871914.yml
3+
openapi_spec_hash: 3c97cfd62d45e01dbadffb67fbfba1a3
44
config_hash: 1666c4673215d2af73eb14329610e026

src/gitpod/types/environment_spec.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,21 @@ class Secret(BaseModel):
158158
name: Optional[str] = None
159159
"""name is the human readable description of the secret"""
160160

161+
scope: Optional[
162+
Literal[
163+
"SCOPE_UNSPECIFIED",
164+
"SCOPE_ORGANIZATION",
165+
"SCOPE_PROJECT",
166+
"SCOPE_USER",
167+
"SCOPE_SERVICE_ACCOUNT",
168+
"SCOPE_RUNNER",
169+
]
170+
] = None
171+
"""
172+
scope indicates where this secret originated from. Used to filter secrets during
173+
build (only org and project secrets are injected).
174+
"""
175+
161176
session: Optional[str] = None
162177
"""
163178
session indicated the current session of the secret. When the session does not

src/gitpod/types/environment_spec_param.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,19 @@ class Secret(TypedDict, total=False):
165165
name: str
166166
"""name is the human readable description of the secret"""
167167

168+
scope: Literal[
169+
"SCOPE_UNSPECIFIED",
170+
"SCOPE_ORGANIZATION",
171+
"SCOPE_PROJECT",
172+
"SCOPE_USER",
173+
"SCOPE_SERVICE_ACCOUNT",
174+
"SCOPE_RUNNER",
175+
]
176+
"""
177+
scope indicates where this secret originated from. Used to filter secrets during
178+
build (only org and project secrets are injected).
179+
"""
180+
168181
session: str
169182
"""
170183
session indicated the current session of the secret. When the session does not

tests/api_resources/test_environments.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None:
109109
"file_path": "filePath",
110110
"git_credential_host": "gitCredentialHost",
111111
"name": "name",
112+
"scope": "SCOPE_UNSPECIFIED",
112113
"session": "session",
113114
"source": "source",
114115
"source_ref": "sourceRef",
@@ -478,6 +479,7 @@ def test_method_create_from_project_with_all_params(self, client: Gitpod) -> Non
478479
"file_path": "filePath",
479480
"git_credential_host": "gitCredentialHost",
480481
"name": "name",
482+
"scope": "SCOPE_UNSPECIFIED",
481483
"session": "session",
482484
"source": "source",
483485
"source_ref": "sourceRef",
@@ -791,6 +793,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) ->
791793
"file_path": "filePath",
792794
"git_credential_host": "gitCredentialHost",
793795
"name": "name",
796+
"scope": "SCOPE_UNSPECIFIED",
794797
"session": "session",
795798
"source": "source",
796799
"source_ref": "sourceRef",
@@ -1160,6 +1163,7 @@ async def test_method_create_from_project_with_all_params(self, async_client: As
11601163
"file_path": "filePath",
11611164
"git_credential_host": "gitCredentialHost",
11621165
"name": "name",
1166+
"scope": "SCOPE_UNSPECIFIED",
11631167
"session": "session",
11641168
"source": "source",
11651169
"source_ref": "sourceRef",

0 commit comments

Comments
 (0)