Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/ee-repo-ref.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c559aa1896dafc98a5000ce1a77bd28a9e087363
0d72102809e766d5285a162dcc30055847700ee2
4 changes: 4 additions & 0 deletions backend/windmill-api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3463,6 +3463,10 @@ paths:
required: true
schema:
type: string
- name: expires_in
in: query
schema:
type: number

responses:
"200":
Expand Down
7 changes: 5 additions & 2 deletions python-client/wmill/wmill/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,11 @@ def get_root_job_id(self, job_id: str | None = None) -> dict:
job_id = job_id or os.environ.get("WM_JOB_ID")
return self.get(f"/w/{self.workspace}/jobs_u/get_root_job_id/{job_id}").json()

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

def get_job_status(self, job_id: str) -> JobStatus:
job = self.get_job(job_id)
Expand Down
4 changes: 3 additions & 1 deletion typescript-client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -945,13 +945,15 @@ export function getResumeEndpoints(approver?: string): Promise<{
/**
* Get an OIDC jwt token for auth to external services (e.g: Vault, AWS) (ee only)
* @param audience audience of the token
* @param expiresIn Optional number of seconds until the token expires
* @returns jwt token
*/
export async function getIdToken(audience: string): Promise<string> {
export async function getIdToken(audience: string, expiresIn?: number): Promise<string> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good addition of the JSDoc comment for the new parameter!

One minor consistency note: The Python client uses expires_in: int | None while TypeScript uses expiresIn?: number. While this follows each language's conventions (snake_case for Python, camelCase for TypeScript), it's worth noting this difference in case it affects any cross-language documentation or API consistency guidelines your team follows.

const workspace = getWorkspace();
return await OidcService.getOidcToken({
workspace,
audience,
expiresIn,
});
}

Expand Down
Loading