lib/ringcentral_sdk/platform/platform.rb in ringcentral_sdk-0.1.1 vs lib/ringcentral_sdk/platform/platform.rb in ringcentral_sdk-0.1.2
- old
+ new
@@ -15,11 +15,10 @@
TOKEN_ENDPOINT = '/restapi/oauth/token'
REVOKE_ENDPOINT = '/restapi/oauth/revoke'
API_VERSION = 'v1.0'
URL_PREFIX = '/restapi'
- attr_reader :client
attr_accessor :server_url
def initialize(app_key='', app_secret='', server_url=RingCentralSdk::Sdk::RC_SERVER_SANDBOX)
@app_key = app_key
@@ -61,18 +60,11 @@
end
def get_api_key()
api_key = (@app_key.is_a?(String) && @app_secret.is_a?(String)) \
- ? Base64.strict_encode64("#{@app_key}:#{@app_secret}") : ''
+ ? Base64.encode64("#{@app_key}:#{@app_secret}").gsub(/[\s\t\r\n]/,'') : ''
return api_key
- end
-
- def get_auth_header()
- if @_auth.token_type.is_a?(String) && @_auth.access_token.is_a?(String)
- return @_auth.token_type + ' ' + @_auth.access_token
- end
- return ''
end
def request(helper=nil)
unless helper.is_a?(RingCentralSdk::Helpers::Request)
raise 'Request is not a RingCentralSdk::Helpers::Request'