Sign inSign up

mfoerster16/pair-programming

By mfoerster16

•Updated over 2 years ago

basic auth - pair programming example

Image
Developer tools
0

1.0K

mfoerster16/pair-programming repository overview

Simple education image provides REST-API with basic auth

usage as docker compose:

version: "3.8"

networks:
  pair-programming:

services:
  pps:
    image: mfoerster16/pair-programming
    container_name: pair-programming_basicAuth
    ports:
      - 4000:4000/tcp
    networks:
      - pair-programming  

Sure, you can add your own user like this:

    volumes:
      - ./data/pps-users.json:/users.json:ro

the pps-users.json example:

    [
        {
            "id": 1,
            "username": "user33",
            "password": "test",
            "firstName": "Docker",
            "lastName": "Container"
        },
        {
            "id": 3,
            "username": "admin",
            "password": "s3cret",
            "firstName": "Super",
            "lastName": "Admin"
        }
    ]

time to try (requiriere jq)

with curl

curl -s -u test:test http://127.0.0.1:4000/users | jq .[2].lastName

or pwsh

curl -s -X POST 'http://127.0.0.1:4000/users/authenticate' --header 'Authorization: Basic dGVzdDp0ZXN0' --header 'Content-Type: application/json'  --data-raw '{"username": "test1","password": "test1"}' | jq .lastName

Tag summary

Content type

Image

Digest

sha256:c9d69ec96…

Size

86.5 MB

Last updated

over 2 years ago

docker pull mfoerster16/pair-programming