hyperioxx / frontman

Frontman is an open-source API gateway written in Go that allows you to manage your microservices and expose them as a single API endpoint. It acts as a reverse proxy and handles requests from clients, routing them to the appropriate backend service.
https://frontman-labs.github.io/frontman/
GNU General Public License v3.0
5 stars 0 forks source link

Add basic auth, and default load balancer #71

Closed nhaydel closed 1 year ago

nhaydel commented 1 year ago

This PR adds basic auth support for backend services.

Steps to test:

  1. Run frontman without any auth config. Ensure apis work as expected.
  2. Specify a basic auth config by adding the following config to a backend service:
    auth:
    type: "basic"
    basic:
      username: "test"
      password: "test"
  3. Verify that requests return 401 unless a basic auth header is specified with the username and password from the config
  4. Repeat steps 2 and 3 with a config specifying env variables:
    auth:
    type: "basic"
    basic:
      usernameEnvVariable: "API_USERNAME"
      passwordEnvVariable: "API_PASSWORD"

note: be sure to set these values in your environment

  1. Repeat steps 2 and 3 with a config specifying a credentials file:
    auth:
    type: "basic"
    basic:
      credentialsFile: "credentials.yaml"

    credentials.yaml

    username: "filetest"
    password: "filetest"
amityahav commented 1 year ago

@nhaydel can u add how-to auth in README file?

hyperioxx commented 1 year ago

@nhaydel can u add how-to auth in README file?

Yes please @nhaydel :)

nhaydel commented 1 year ago

@nhaydel can u add how-to auth in README file?

Sorry. Busy weekend. I'll add that this morning. @hyperioxx @amityahav