Module: Code42::API::Token
- Included in:
- Client
- Defined in:
- lib/code42/api/token.rb
Instance Method Summary collapse
-
#delete_token(token = nil) ⇒ Object
Manually expires a token.
-
#get_login_token ⇒ CrashPlan::Token
Returns LoginToken and ServerUrl.
-
#get_token ⇒ Object
Gets a token for the currently authorized user.
-
#validate_token(token) ⇒ Code42::TokenValidation
Validates an authorization token.
Instance Method Details
#delete_token(token = nil) ⇒ Object
Manually expires a token
26 27 28 29 |
# File 'lib/code42/api/token.rb', line 26 def delete_token(token = nil) token = token || settings.token delete "authToken/#{token.to_s}" end |
#get_login_token ⇒ CrashPlan::Token
Returns LoginToken and ServerUrl
13 14 15 |
# File 'lib/code42/api/token.rb', line 13 def get_login_token object_from_response(Code42::Token, :post, "loginToken") end |
#get_token ⇒ Object
Gets a token for the currently authorized user
7 8 9 |
# File 'lib/code42/api/token.rb', line 7 def get_token object_from_response(Code42::Token, :post, "authToken") end |
#validate_token(token) ⇒ Code42::TokenValidation
Validates an authorization token
20 21 22 |
# File 'lib/code42/api/token.rb', line 20 def validate_token(token) object_from_response(Code42::TokenValidation, :get, "authToken/#{token.to_s}") end |