Giter Site home page Giter Site logo

mjtrangoni / oauth2-proxy-nexus3 Goto Github PK

View Code? Open in Web Editor NEW
2.0 0.0 0.0 246 KB

Glue between oauth2-proxy, some Auth provider and Sonatype Nexus 3.

License: Apache License 2.0

Shell 10.33% Groovy 2.40% Go 85.26% Dockerfile 2.01%
gitlab nexus oauth2 nexus-repository nexus-repository-manager oauth2-proxy keycloak nexus3

oauth2-proxy-nexus3's Introduction

oauth2-proxy-nexus3

CI golangci-lint

This service is designed to operate as a proxy between oauth2-proxy, an Auth provider (AP), which is the one configured for oauth2-proxy, and Sonatype Nexus 3. It was forked from oauth2-proxy-nexus3, updated, and adapted to work with a generic provider.

Typical setup

********** 1↔↔ ********* 1↔↔ **************** 5↔↔ *********************** 5↔↔ ***********
*        * 2↔↔ *       * 3↔↔ *              *     * oauth2-proxy-nexus3 *     * Nexus 3 *
* Client * 3↔↔ * Nginx * 4↔↔ * oauth2-proxy *     ***********************     ***********
*        * 4↔↔ *       * 5↔↔ *              *     5
********** 5↔↔ *********     ****************     ↕
                       2     3                    ↕
                       ↕     ↕                    ↕
                       ↔↔↔↔↔ ******************** ↔
                             * AP (e.g. OICD Generic,*
                             *          GitLab) *
                             ********************
  1. Sign in and redirect to the AP.
  2. Login and authorize the application.
  3. Ask for a token.
  4. Follow the callback to oauth2-proxy and finalize the OAuth flow.
  5. oauth2-proxy verify and authorize each request to oauth2-proxy-nexus3. The OAuth access token if send through a header to oauth2-proxy-nexus3 by oauth2-proxy and is used to keep in sync the Nexus 3 userbase with the AP (which is the OIDC too).

Container image

Built images are hosted at quay.io.

$ docker pull quay.io/mjtrangoni/oauth2-proxy-nexus3

Configuration

ENV Mandatory? Default value Description
O2PN3_LISTEN_ON 0.0.0.0:8080 The [IP]:PORT on which the HTTP server will listen.
O2PN3_LOG_LEVEL info Set Application log level.
O2PN3_SSL_INSECURE_SKIP_VERIFY false Skip SSL verifications if set to true.
O2PN3_AP oidc_generic The name of the Auth Provider to be used. (oicd_generic, gitlab)
O2PN3_AP_URL The AP URL on which OAuth operations will be performed.
O2PN3_AP_ACCESS_TOKEN_HEADER X-Forwarded-Access-Token The name of the HTTP header on which the AP OAuth access_token will be provided to this service.
O2PN3_OAUTH2_PROXY_COOKIE_NAME x _oauth2_proxy The name of the cookie that the oauth_proxy creates. Should be changed to use a cookie prefix if --cookie-secure is set.
O2PN3_NEXUS3_URL The Nexus 3 URL on which sync and reverse-proxying will be performed.
O2PN3_NEXUS3_ADMIN_USER A Nexus 3 admin user.
O2PN3_NEXUS3_ADMIN_PASSWORD A Nexus 3 admin password.
O2PN3_NEXUS3_RUT_HEADER X-Forwarded-User The name of the HTTP header used by the Rut Realm/capability (Nexus 3) for the authentication.
O2PN3_REDIS_CONNECTION_URL localhost:6379 The tcp connection to the redis instance.
O2PN3_REDIS_PASSWORD "" The password of the redis instance. Default is empty or no password.
O2PN3_REDIS_TTL_HOURS 168 The number of hours until the oauth2-proxy session cookie expire.

Prerequisites

oauth2-proxy

The -pass-access-token flag or OAUTH2_PROXY_PASS_ACCESS_TOKEN environment variable must be set to true.

Nexus 3

The Rut Realm/capability must be enabled and configured the use the same HTTP header as configured in via $O2PN3_NEXUS3_RUT_HEADER.

Redis

A redis instance needs to be reachable to store the oauth2-proxy session cookie.

oauth2-proxy-nexus3's People

Contributors

le-garff-yoann avatar mjtrangoni avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.