Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

his_emr_user_management

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

his_emr_user_management

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

UserManagement

Short description and motivation. This gem provides generic functionality for EMRs user management to integrate with an LDAP server via the Single sign on Service (sss) just by plugging it into your application(s).

Usage

How to use my plugin.

The plugin needs to be mounted into your application and the api's it exposes will be available via the mounted point.

Installation

Add this line to your application's Gemfile:

gem 'user_management', :git => 'https://github.com/EGPAFMalawiHIS/emr_usermanagement_engine.git', :branch => 'main'

Add this line to your routes.rb file:

mount UserManagement::Engine, at: "/api/v1"

Create a file config/settings.yml and add the following structure:

secret_key: ""
duplicate_precision: 90
gateway_key: 'usermanagement'
sss_url: localhost:3001

-- Generate a key and put it on the secret_key value and update the other key as necessary use command 'rake secret'

Add the following code to your application_controller.rb

before_action :authorized_user

  def authorized_user
    token = request.headers[:Authorization]
    response = JSON.parse(UserManagement::ApplicationController.authorized(token))
    return render json: {status: 403, message: 'User not authorised or token expired'} if response['status'] == 403
    return render json: {status: 401, message: 'Invalid username or password'} if response['status'] == 401
  end

And then execute:

$ bundle i

In Rails.root of your application execute:

bin/rails user_management:install:migrations
bin/rails db:migrate

Contributing

Contribution directions go here.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 23 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc