Commit eb65011a authored by Chris Hines's avatar Chris Hines
Browse files

use request ssh certificate generation directly from the spa

parent 5b4275bc
Pipeline #11141 passed with stages
in 3 minutes and 25 seconds
......@@ -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) })
)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment