1.0.5 • Published 3 years ago

@open-cluster-management/security-middleware v1.0.5

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

security-middleware

Security middleware for the Openshift OAuth server

Usage

Production

No configuration is required to run it in production mode.

Development

To run it locally, you will need to set following environment variables:

OAUTH2_CLIENT_ID      # OAuth Client ID
OAUTH2_CLIENT_SECRET  # OAuth Client Secret
OAUTH2_REDIRECT_URL   # Redirect URL
API_SERVER_URL        # Kubernetes API URL
SERVICEACCT_TOKEN     # Kubernetes Access Token

For more information about Openshift OAuth, see the Openshift documentation

Use it

  • To protect the ui:

    const inspect = require('security-middleware')
    router.all(['/', '/*'], inspect.ui(), app)
  • To protect the api:

    const inspect = require('security-middleware')
    router.all(['/', '/*'], inspect.app, app)