npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

esante-iam

v3.0.9

Published

esante-iam

Downloads

1

Readme

eSante IAM API

Overview

This repo contains the esante-iam api which handles everything related to Users, Orgs, Roles, Permissions, and Authentication. IAM has three distinct microservices.

  • Auth microservice
  • Organizations microservice
  • Users microservice

Auth microservice

Handles authentication and authorization operations across the entire eSante system.

Organizations microservice

Manages creating and querying eSante organizations managed within the eSante portal.

Users microservice

Handles creating and querying eSante users likewise managed within the eSante portal.

Project Structure

| path | description | | ----------------- | ----------------------------------- | | .githooks | git hooks folder | | .circlei | circle ci pipeline configs | | server.js | local development server entrypoint | | lambda.js | serverless lambda fn entrypoint | | serverless.yml | serverless deployment configuration | | .environ | per env serverless configs | | src | source code folder | | src/index.js | app api entrypoint | | src/_app | app api endpoint init code | | src/auth | auth microservice code | | src/organizations | organizations microservice code | | src/users | users microservice code | | src/utils | utility/helper code |

Running Locally

Please follow these steps to run the service locally:

  • create ssh tunnel to devleopment database
pg_tunnel esante-dev dev-pg-cluster.cluster-cqkfvl6ken4r.us-east-2.rds.amazonaws.com localhost

note! please see confluence R&D guides for explanation of how to setup ssh tunnels for development databases

Create .env file to point api to dev enrironment

touch .env

set contents to

GRAPHQL_INTROSPECTION=true
SECRET_ENV_NAME=dev/esante
TENANTS_TABLE="dev-esante-tenants"
SERVICES_TABLE="dev-esante-services"
AWS_REGION=us-east-2

Set AWS credentails

open your aws sso account panel to grab your AWS export statements to set your aws credentails in the terminal

export AWS_ACCESS_KEY_ID="XXX"
export AWS_SECRET_ACCESS_KEY="XXX"
export AWS_SESSION_TOKEN="XXX"

Run start script

npm start

on startup you should see similar output as below

> [email protected] start
> nodemon --watch src ./server.js

[nodemon] 2.0.22
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): src/**/*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node ./server.js`
esante:env INFO - Loaded 81 environment variables
esante:api INFO - Configuring GRAPHQL endpoint
esante:api INFO - Configuring REST endpoint
esante:app:server INFO - 🚀 Server be4b55afc3f247279d3fc8b61e851230 started in 357 ms on port 9012

Done

now you can point your insonmia or postman at the localport and execute api calls 🥳

Endpoints

Is Authorized

For checking if a user is authorized to perform specific task based on the permissions it has on record.

Method: GET

{{IAM_API}}/auth/isAuthorized

Headers

| Content-Type | Value | | ------------ | ----- | | tenantId | p3n |


Get Permissions

For retriveing a list of permissions that a user has on record.

Method: POST

{{IAM_API}}/auth/permissions

Headers

| Content-Type | Value | | ------------ | ----- | | tenantId | p3n |


User Microservice

Who Am I

Can be queried to return information on the user making the request.

Method: GET

{{IAM_API}}/user/whoami

Headers

| Content-Type | Value | | ------------ | ----- | | tenantId | p3n |


Graphql

Beyond the previously listed rest endpoints there are many more graphql endpoints, however, since graphql is self documenting they are not listed here.