From 069947789a605dd028333213de080be2409d54fb Mon Sep 17 00:00:00 2001 From: Brett Gerry Date: Tue, 29 Oct 2013 14:42:04 -0700 Subject: [PATCH] merge capability token timestamp fix --- src/classes/TwilioCapability.cls | 33 -------------------------------- 1 file changed, 33 deletions(-) diff --git a/src/classes/TwilioCapability.cls b/src/classes/TwilioCapability.cls index 9e93b04..1dc0281 100644 --- a/src/classes/TwilioCapability.cls +++ b/src/classes/TwilioCapability.cls @@ -112,7 +112,6 @@ global class TwilioCapability { this.scopes.add(buildScopeString('stream', 'subscribe', value)); } -<<<<<<< HEAD /** * Generates a new token based on the credentials and permissions that * previously has been granted to this token. @@ -142,38 +141,6 @@ global class TwilioCapability { payload.put('scope', join(this.scopes, ' ')); return jwtEncode(payload, this.authToken); } -======= - /** - * Generates a new token based on the credentials and permissions that - * previously has been granted to this token. - * - * @return the newly generated token that is valid for 3600 seconds - */ - global String generateToken() { - return generateToken(3600); - } - - /** - * Generates a new token based on the credentials and permissions that - * previously has been granted to this token. - * - * @param expiresAt - * the expiration instance of the token. - * @return the newly generated token that is valid for ttl seconds - */ - global String generateToken(long ttl) { - // Build these scopes lazily when we generate tokens so we know - // if we have a default or incoming client name to use - buildIncomingScope(); - buildOutgoingScope(); - Map payload = new Map(); - payload.put('iss', this.accountSid); - payload.put('exp', String.valueOf(System.currentTimeMillis()/1000 + ttl)); - payload.put('scope', join(this.scopes, ' ')); - return jwtEncode(payload, this.authToken); - } ->>>>>>> 2c915fb8265a9ce66ddd795c4da3e6915d62e809 - /* PRIVATE METHODS */