You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Phobos Checkpoint UI is a GUI for phobos checkpoint API. It is compatible with Phobos DB Checkpoint
Installation
Add this line to your application's Gemfile:
gem'phobos_checkpoint_ui'
And then execute:
$ bundle
Or install it yourself as:
$ gem install phobos_checkpoint_ui
Usage
Add require 'phobos_checkpoint_ui/tasks' to your Rakefile
Run rake phobos_checkpoint_ui:copy_assets, this will copy the precompile assets to ./public
Create/update config.ru and add:
require'phobos_checkpoint_ui'# ...# < keep the previous configurations ># ...# run PhobosDBCheckpoint::EventsAPIrunPhobosCheckpointUI::App.new(api_app: PhobosDBCheckpoint::EventsAPI)
It is possible to configure some aspects of the app, App.new accepts a hash with options to be delivered to the front-end. The front-end is prepared to receive the following options:
logo - Path of image to be used as a logo (can be something inside /public)
If saml_config is not provided the Events API will be open for anyone to access.
PhobosCheckpointUI ships with a default SamlHandler that does not handle authorization, being authenticated is enough. It also sets the same default username for all users. If you want to tweak this, you can customize it (see below)
Customizing the SAML handler
If authenticating with IDP is not enough, and you want more control over authorization, you can customize this with your own SamlHandler.
Example:
classMySamlHandler < PhobosCheckpointUI::SamlHandlerdefself.authorized?(user_json)# my custom checkendendrunPhobosCheckpointUI::App.new(api_app: PhobosDBCheckpoint::EventsAPI,saml_handler: MySamlHandler)
If saml_handler is not specified, PhobosCheckpointUI::SamlHandler will be used instead which returns some default values without looking at IDP payload.
Logging
Logging middleware can be injected via the logging_middleware option.
The logger middleware will inject itself as rack middleware. If not specified, Rack::NullLogger will be used (no logging).
Development
The front-end is written with React and Redux, ensure that you have nodejs version >= 6.3 installed.
cd frontend
npm install
npm run test:unit #or npm run test:unit:watch to continuosly run the tests
Run rake spec to run the ruby tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.