Skip to content
Snippets Groups Projects
Commit eb65011a authored by Chris Hines's avatar Chris Hines
Browse files

use request ssh certificate generation directly from the spa

parent 5b4275bc
No related branches found
No related tags found
4 merge requests!106if stat fails, display the error instead of immediately refreshing...,!99Dev,!68Test,!67use request ssh certificate generation directly from the spa
Pipeline #11141 passed
......@@ -107,11 +107,14 @@ export class KeygenComponent implements OnInit, OnDestroy {
}
getCert(token: AuthToken, key: any, apiserver: APIServer): Observable<any> {
let headers = new HttpHeaders();
let headers = new HttpHeaders({'Authorization':'Bearer '+token.token});
let options = { headers: headers, withCredentials: false};
let data = {'token': token.token, 'pubkey': key.public, 'signing_url': token.sshauthzservice.sign};
return this.http.post<any>(apiserver.tes+'/getcert',data, options).pipe(
map((v) => v.cert),
var now = new Date()
var end = new Date(now.getTime() + 24*60*60*1000); //request a certificate valid for 24 hours
let data = {'public_key': key.public, 'end': end.toISOString()};
return this.http.post<any>(token.sshauthzservice.sign,data, options).pipe(
tap((v) => console.log('in getCert',v)),
map((v) => v.certificate),
catchError((e) => { console.error(e); return throwError(token) })
)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment