Increase nxapi-auth assertion validity

This commit is contained in:
Samuel Elliott 2025-09-08 02:20:33 +01:00
parent d5723f9ea7
commit 2de9ce365f
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6

View File

@ -58,21 +58,21 @@ export class ClientAssertionProvider implements ClientAssertionProviderInterface
public scope = 'ca:gf ca:er ca:dr',
) {}
async create(aud: string, exp = 60) {
async create(aud: string, exp = 300) {
const assertion = await this.createAssertion(aud, exp);
const type = 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer';
return { assertion, type };
}
async createAssertion(aud: string, exp = 60) {
async createAssertion(aud: string, exp: number) {
const jwt = this.createAssertionJwt(aud, exp);
const key = await this.createAssertionKey();
return jwt.sign(key);
}
createAssertionJwt(aud: string, exp = 60) {
createAssertionJwt(aud: string, exp: number) {
const now = Math.floor(Date.now() / 1000);
const data = Buffer.alloc(22 + (release?.length ?? 0));