Class: OauthIssuersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- OauthIssuersController
- Defined in:
- app/controllers/oauth_issuers_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
-
#index ⇒ Object
oauth_required :only => [:create, :destroy].
- #show ⇒ Object
Instance Method Details
#create ⇒ Object
19 20 21 22 23 24 25 |
# File 'app/controllers/oauth_issuers_controller.rb', line 19 def create attrs = {:identifier => params[:issuer_id], :hmac_secret => params[:issuer_secret]} issuer = Rack::OAuth2::Server.register_issuer(attrs) render :json => issuer.to_json end |
#destroy ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/oauth_issuers_controller.rb', line 27 def destroy issuer = Rack::OAuth2::Server.get_issuer(params[:id]) if issuer issuer.destroy render :nothing => true, :status => :ok else render :nothing => true, :status => :not_found end end |
#index ⇒ Object
oauth_required :only => [:create, :destroy]
4 5 6 7 |
# File 'app/controllers/oauth_issuers_controller.rb', line 4 def index issuers = Rack::OAuth2::Server::Issuer.collection.find.entries render :json => issuers.to_json end |
#show ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/oauth_issuers_controller.rb', line 9 def show issuer = Rack::OAuth2::Server.get_issuer(params[:id]) if issuer render :json => issuer.to_json else render :nothing => true, :status => :not_found end end |