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>
This commit is contained in:
hugocasa
2025-12-08 19:00:51 +01:00
committed by GitHub
parent e8ca7c5f95
commit e6adf16fc9
4 changed files with 13 additions and 4 deletions
+1 -1
View File
@@ -1 +1 @@
c559aa1896dafc98a5000ce1a77bd28a9e087363
0d72102809e766d5285a162dcc30055847700ee2
+4
View File
@@ -3467,6 +3467,10 @@ paths:
required: true
schema:
type: string
- name: expires_in
in: query
schema:
type: number
responses:
"200":
+5 -2
View File
@@ -413,8 +413,11 @@ class Windmill:
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)
+3 -1
View File
@@ -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> {
const workspace = getWorkspace();
return await OidcService.getOidcToken({
workspace,
audience,
expiresIn,
});
}