Skip to content

Commit e6adf16

Browse files
feat: add query arg for oidc expiration (#7312)
* feat: add query arg for oidc expiration * Update ee-repo-ref.txt * Update ee-repo-ref.txt --------- Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
1 parent e8ca7c5 commit e6adf16

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

backend/ee-repo-ref.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c559aa1896dafc98a5000ce1a77bd28a9e087363
1+
0d72102809e766d5285a162dcc30055847700ee2

backend/windmill-api/openapi.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3467,6 +3467,10 @@ paths:
34673467
required: true
34683468
schema:
34693469
type: string
3470+
- name: expires_in
3471+
in: query
3472+
schema:
3473+
type: number
34703474

34713475
responses:
34723476
"200":

python-client/wmill/wmill/client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,11 @@ def get_root_job_id(self, job_id: str | None = None) -> dict:
413413
job_id = job_id or os.environ.get("WM_JOB_ID")
414414
return self.get(f"/w/{self.workspace}/jobs_u/get_root_job_id/{job_id}").json()
415415

416-
def get_id_token(self, audience: str) -> str:
417-
return self.post(f"/w/{self.workspace}/oidc/token/{audience}").text
416+
def get_id_token(self, audience: str, expires_in: int | None = None) -> str:
417+
params = {}
418+
if expires_in is not None:
419+
params["expires_in"] = expires_in
420+
return self.post(f"/w/{self.workspace}/oidc/token/{audience}", params=params).text
418421

419422
def get_job_status(self, job_id: str) -> JobStatus:
420423
job = self.get_job(job_id)

typescript-client/client.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,13 +945,15 @@ export function getResumeEndpoints(approver?: string): Promise<{
945945
/**
946946
* Get an OIDC jwt token for auth to external services (e.g: Vault, AWS) (ee only)
947947
* @param audience audience of the token
948+
* @param expiresIn Optional number of seconds until the token expires
948949
* @returns jwt token
949950
*/
950-
export async function getIdToken(audience: string): Promise<string> {
951+
export async function getIdToken(audience: string, expiresIn?: number): Promise<string> {
951952
const workspace = getWorkspace();
952953
return await OidcService.getOidcToken({
953954
workspace,
954955
audience,
956+
expiresIn,
955957
});
956958
}
957959

0 commit comments

Comments
 (0)