From 9776dd10fc60efde38946588d0955c406f6c1f5e Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 8 Apr 2014 14:22:56 +0200 Subject: move users: config and lib --- config/routes.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'config/routes.rb') diff --git a/config/routes.rb b/config/routes.rb index f8bb8fb..05eca9b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -16,4 +16,31 @@ LeapWeb::Application.routes.draw do end get '/provider.json' => 'static_config#provider' + + namespace "api", { module: "v1", + path: "/1/", + defaults: {format: 'json'} } do + resources :sessions, :only => [:new, :create, :update] + delete "logout" => "sessions#destroy", :as => "logout" + resources :users, :only => [:create, :update, :destroy, :index] + resources :messages, :only => [:index, :update] + end + + scope "(:locale)", :locale => MATCH_LOCALE do + get "login" => "sessions#new", :as => "login" + delete "logout" => "sessions#destroy", :as => "logout" + + get "signup" => "users#new", :as => "signup" + resources :users, :except => [:create, :update] do + # resource :email_settings, :only => [:edit, :update] + # resources :email_aliases, :only => [:destroy], :id => /.*/ + post 'deactivate', on: :member + post 'enable', on: :member + end + end + + get "/.well-known/host-meta" => 'webfinger#host_meta' + get "/webfinger" => 'webfinger#search' + get "/key/:login" => 'keys#show' + end -- cgit v1.2.3 From c1486cb9688d53c5ae266ff22ab279ead12eaa36 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 10 Apr 2014 12:45:21 +0200 Subject: move certs into toplevel cleaned up all the engine stuff that was never really used. Afterwards there is not that much left that makes it into the toplevel. --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'config/routes.rb') diff --git a/config/routes.rb b/config/routes.rb index 05eca9b..b930bd1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -24,6 +24,7 @@ LeapWeb::Application.routes.draw do delete "logout" => "sessions#destroy", :as => "logout" resources :users, :only => [:create, :update, :destroy, :index] resources :messages, :only => [:index, :update] + resource :cert, :only => [:show] end scope "(:locale)", :locale => MATCH_LOCALE do -- cgit v1.2.3 From 8cc5ba134f6c5a1a06d91407aa78b962545c54ac Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 17 Apr 2014 11:42:13 +0200 Subject: initial commit for the service level api :api/service will return a hash of the current users service level This is failiing if the user is not logged in. Instead it should return the service description for an anonymous user. --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'config/routes.rb') diff --git a/config/routes.rb b/config/routes.rb index b930bd1..f612b47 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -25,6 +25,7 @@ LeapWeb::Application.routes.draw do resources :users, :only => [:create, :update, :destroy, :index] resources :messages, :only => [:index, :update] resource :cert, :only => [:show] + resource :service, :only => [:show] end scope "(:locale)", :locale => MATCH_LOCALE do -- cgit v1.2.3 From 86eb9062f1e81302647bf18ce0f5fd981202b68a Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 13 May 2014 09:51:36 +0200 Subject: allow for usernames with dots preparing for #5664 with some test improvements i ran into this issue This commit includes a fix and the test improvements. In particular it adds BrowserIntegrationTest#login - so there is no need to go through the signup procedure everytime you want a user to be logged in. --- config/routes.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'config/routes.rb') diff --git a/config/routes.rb b/config/routes.rb index f612b47..745b97d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -20,7 +20,8 @@ LeapWeb::Application.routes.draw do namespace "api", { module: "v1", path: "/1/", defaults: {format: 'json'} } do - resources :sessions, :only => [:new, :create, :update] + resources :sessions, :only => [:new, :create, :update], + :constraints => { :id => /[^\/]+(?=\.json\z)|[^\/]+/ } delete "logout" => "sessions#destroy", :as => "logout" resources :users, :only => [:create, :update, :destroy, :index] resources :messages, :only => [:index, :update] -- cgit v1.2.3