Sha256: 0a7c2f5c05476cf8af62c69394ea0b17f8443f24bab2b7695410649641540eca

Contents?: true

Size: 464 Bytes

Versions: 22

Compression:

Stored size: 464 Bytes

Contents

Server.api :get_api_token, :admin do |params,user|
    warning_message = "API method 'get_api_token' is deprecated.
      Use 'login' method only, it returns api token in response's body"
    params[:warning] = warning_message unless params.nil?
    do_get_api_token(params, user)
end

def do_get_api_token(params, user)
  if user and user.admin == 1 and user.token
    user.token.value 
  else
    raise ApiException.new(422, "Invalid/missing API user")
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
rhoconnect-3.2.1 lib/rhoconnect/api/admin/get_api_token.rb
rhoconnect-3.2.0 lib/rhoconnect/api/admin/get_api_token.rb
rhoconnect-3.2.0.beta5 lib/rhoconnect/api/admin/get_api_token.rb
rhoconnect-3.2.0.beta4 lib/rhoconnect/api/admin/get_api_token.rb
rhoconnect-3.2.0.beta3 lib/rhoconnect/api/admin/get_api_token.rb
rhoconnect-3.2.0.beta2 lib/rhoconnect/api/admin/get_api_token.rb
rhoconnect-3.2.0.beta1 lib/rhoconnect/api/admin/get_api_token.rb
rhoconnect-3.1.2 lib/rhoconnect/api/admin/get_api_token.rb
rhoconnect-3.1.1 lib/rhoconnect/api/admin/get_api_token.rb
rhoconnect-3.1.0 lib/rhoconnect/api/admin/get_api_token.rb
rhoconnect-3.1.0.beta2 lib/rhoconnect/api/admin/get_api_token.rb
rhoconnect-3.1.0.beta1 lib/rhoconnect/api/admin/get_api_token.rb
rhoconnect-3.0.6 lib/rhoconnect/api/admin/get_api_token.rb
rhoconnect-3.0.5 lib/rhoconnect/api/admin/get_api_token.rb
rhoconnect-3.0.4 lib/rhoconnect/api/admin/get_api_token.rb
rhoconnect-3.0.3 lib/rhoconnect/api/admin/get_api_token.rb
rhoconnect-3.0.2 lib/rhoconnect/api/admin/get_api_token.rb
rhoconnect-3.0.1 lib/rhoconnect/api/admin/get_api_token.rb
rhoconnect-3.0.0 lib/rhoconnect/api/admin/get_api_token.rb
rhoconnect-3.0.0.rc1 lib/rhoconnect/api/admin/get_api_token.rb