Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

En enkel Unleash-server med Google IAP pålogging

License

NotificationsYou must be signed in to change notification settings

nais/unleash

Repository files navigation

Workflow status

SimpleUnleash v5 server withGoogle IAP authentication. Built to work well withUnleasherator our Kubernetes operator for managing Unleash instances.

sequenceDiagram    participant User    participant Google IAP    participant Google Auth    participant Unleash    autonumber    User->>Google IAP: request    alt is not authenticated        Google IAP->>Google Auth: Redirect to login        Google Auth->>Google IAP: Redirect to callback    end    alt is not authorized        Google IAP->>User: 403    end    Google IAP->>Unleash: request    Unleash->>User: response
Loading

Configuration

Authentication

environment variabledescriptiondefault
GOOGLE_IAP_JWT_HEADERHeader name for JWT token from Google IAPx-goog-iap-jwt-assertion
GOOGLE_IAP_JWT_ISSUERIssuer for JWT token from Google IAPhttps://cloud.google.com/iap
GOOGLE_IAP_JWT_AUDIENCEAudience for JWT token from Google IAPREQUIRED
IAP_PUBLIC_KEY_CACHE_TIMECache time for JWT token public keys from Google IAP3600

GOOGLE_IAP_JWT_AUDIENCE should be a string in the following format:

/projects/PROJECT_NUMBER/global/backendServices/SERVICE_ID

Authorization

environment variabledescriptiondefault
TEAMS_API_URLURL for Teams APIREQUIRED
TEAMS_API_TOKENToken for Teams APIREQUIRED
TEAMS_ALLOWED_TEAMSTeams allowed to access UnleashREQUIRED
TEAMS_USER_VALIDATION_CACHE_TIMECache time for Teams user validation3600

Unleash configuration

environment variabledescriptiondefault
INIT_ADMIN_API_TOKENSAdmin API tokens to create on startupREQUIRED
AUTH_ENABLE_API_TOKENEnable API token authenticationtrue
SERVER_PORTPort to listen on4242
DATABASE_USERNAMEUsername for database connectionunleash
DATABASE_PASSWORDPassword for database connectionunleash
DATABASE_NAMEDatabase nameunleash
DATABASE_HOSTDatabase hostlocalhost
DATABASE_SSLUse SSL for database connectionfalse
DATABASE_PORTDatabase port5432

Setup for local development

Prerequisites

Running Unleash

The simplest way to run Unleash is to usedocker-compose:

docker-compose up --build

This will start a local Postgres database in a Docker container and expose Unleash onhttp://localhost:8080.

To build the code, runyarn build. This will compile the TypeScript files to ES2017 and place them in./dist/. Unleash can then be run withyarn start. For convenience you can also use theyarn build-and-start command.

Running Unleash locally requires a database. The easiest way to get one is to use Docker:

docker-compose up -d postgres

This will start a local Postgres database in a Docker container. You can then connect to it using the following credentials:

export DATABASE_USERNAME=unleashexport DATABASE_PASSWORD=unleashexport DATABASE_NAME=unleashexport DATABASE_HOST=localhostexport DATABASE_SSL=false

You also need the following environment variables:

export INIT_ADMIN_API_TOKENS=*:*.unleash4allexport GOOGLE_IAP_AUDIENCE=/projects/123/global/backendServices/123

Contact

Requests and questions can be made via issues on the repo. For NAV employees this can be done easiest via the slack channel#unleash.

License

MIT


[8]ページ先頭

©2009-2025 Movatter.jp