Initial commit
This commit is contained in:
commit
95c62e2941
5 changed files with 71 additions and 0 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
node_modules
|
||||||
|
/gems
|
||||||
|
/auto_generated
|
11
app/controllers/discourse_scim_plugin/scim_controller.rb
Normal file
11
app/controllers/discourse_scim_plugin/scim_controller.rb
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module ::DiscourseScimPlugin
|
||||||
|
class ScimController < ::ApplicationController
|
||||||
|
requires_plugin PLUGIN_NAME
|
||||||
|
|
||||||
|
def index
|
||||||
|
render json: { hello: "world" }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
24
config/routes.rb
Normal file
24
config/routes.rb
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require "scimitar"
|
||||||
|
|
||||||
|
# DiscourseScimPlugin::Engine.routes.draw do
|
||||||
|
# get "/list" => "scim#index"
|
||||||
|
# end
|
||||||
|
|
||||||
|
# Discourse::Application.routes.draw { mount ::DiscourseScimPlugin::Engine, at: "/scim" }
|
||||||
|
|
||||||
|
namespace :scim_v2 do
|
||||||
|
DiscourseScimPlugin::Engine.routes.draw do
|
||||||
|
get 'Users', to: 'users#index'
|
||||||
|
get 'Users/:id', to: 'users#show'
|
||||||
|
post 'Users', to: 'users#create'
|
||||||
|
put 'Users/:id', to: 'users#replace'
|
||||||
|
patch 'Users/:id', to: 'users#update'
|
||||||
|
delete 'Users/:id', to: 'users#destroy'
|
||||||
|
end
|
||||||
|
|
||||||
|
Discourse::Application.routes.draw {
|
||||||
|
mount Scimitar::Engine, at: '/scim'
|
||||||
|
}
|
||||||
|
end
|
8
lib/discourse_scim_plugin/engine.rb
Normal file
8
lib/discourse_scim_plugin/engine.rb
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module DiscourseScimPlugin
|
||||||
|
class Engine < ::Rails::Engine
|
||||||
|
engine_name PLUGIN_NAME
|
||||||
|
isolate_namespace DiscourseScimPlugin
|
||||||
|
end
|
||||||
|
end
|
25
plugin.rb
Normal file
25
plugin.rb
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# name: discourse-scim-plugin
|
||||||
|
# about: A plugin to add SCIM endpoints to discourse
|
||||||
|
# version: 0.0.1
|
||||||
|
# authors: Peter Bouda
|
||||||
|
# url: https://github.com/pbouda/discourse-scim-plugin
|
||||||
|
|
||||||
|
gem 'marcel', '1.0.0', {require: false }
|
||||||
|
gem 'activestorage', '7.1.4', {require: false }
|
||||||
|
gem 'actiontext', '7.1.4', {require: false }
|
||||||
|
gem 'actionmailbox', '7.1.4', {require: false }
|
||||||
|
gem 'websocket-extensions', '0.1.0', {require: false }
|
||||||
|
gem 'websocket-driver', '0.6.1', {require: false }
|
||||||
|
gem 'actioncable', '7.1.4', {require: false }
|
||||||
|
gem 'rails', '7.1.4', {require: false }
|
||||||
|
gem 'scimitar', '2.9.0', {require: false }
|
||||||
|
|
||||||
|
require "scimitar"
|
||||||
|
|
||||||
|
module ::DiscourseScimPlugin
|
||||||
|
PLUGIN_NAME = "scim"
|
||||||
|
|
||||||
|
require_relative "lib/discourse_scim_plugin/engine"
|
||||||
|
end
|
Loading…
Reference in a new issue