github.com/stackdocker/rkt@v0.10.1-0.20151109095037-1aa827478248/tests/test-auth-server/README.md (about)

     1  Before running `test-aci-auth-server` make sure that `go` and `actool` are in your
     2  `$PATH`.
     3  
     4  ```
     5  $ ./test-aci-auth-server start basic
     6  
     7  {
     8  	"rktKind": "auth",
     9  	"rktVersion": "v1",
    10  	"domains": ["127.0.0.1:48608"],
    11  	"type": "basic",
    12  	"credentials":
    13  	{
    14  		"user": "bar",
    15  		"password": "baz"
    16  	}
    17  }
    18  
    19  Ready, waiting for connections at https://127.0.0.1:48608
    20  ```
    21  
    22  (You can run `test-aci-auth-server start` with either `none`, `basic` or `oauth` parameter)
    23  
    24  Copy the snippet to `/etc/rkt/auth.d/test.json` and run `rkt
    25  --insecure-skip-verify run
    26  https://127.0.0.1:48608/<WHATEVER>/prog.aci`. The `rkt` output ought
    27  to be something like:
    28  ```
    29  # rkt --insecure-skip-verify run https://127.0.0.1:48608/basic1/prog.aci
    30  rkt: fetching image from https://127.0.0.1:48608/basic1/prog.aci
    31  
    32  
    33  
    34  Authentication succeeded.
    35  Sending SIGTERM to remaining processes...
    36  Sending SIGKILL to remaining processes...
    37  Unmounting file systems.
    38  Unmounting /opt/stage2/testprog/rootfs/dev/pts.
    39  Unmounting /opt/stage2/testprog/rootfs/dev/shm.
    40  Unmounting /opt/stage2/testprog/rootfs/sys.
    41  Unmounting /opt/stage2/testprog/rootfs/proc.
    42  Unmounting /opt/stage2/testprog/rootfs/dev/console.
    43  Unmounting /opt/stage2/testprog/rootfs/dev/tty.
    44  Unmounting /opt/stage2/testprog/rootfs/dev/urandom.
    45  Unmounting /opt/stage2/testprog/rootfs/dev/random.
    46  Unmounting /opt/stage2/testprog/rootfs/dev/full.
    47  Unmounting /opt/stage2/testprog/rootfs/dev/zero.
    48  Unmounting /opt/stage2/testprog/rootfs/dev/null.
    49  Unmounting /opt/stage2/testprog/rootfs.
    50  Unmounting /proc/sys/kernel/random/boot_id.
    51  Unmounting /opt/stage2/testprog/rootfs.
    52  All filesystems unmounted.
    53  Halting system.
    54  ```
    55  
    56  While the additional output from `test-aci-auth-server`:
    57  ```
    58  Trying to serve "/basic10/prog.aci"
    59    serving
    60      done.
    61  ```
    62  
    63  The `test-aci-auth-server start` with `oauth` will print something like this:
    64  ```
    65  $ ./test-aci-auth-server start oauth
    66  
    67  {
    68  	"rktKind": "auth",
    69  	"rktVersion": "v1",
    70  	"domains": ["127.0.0.1:48805"],
    71  	"type": "oauth",
    72  	"credentials":
    73  	{
    74  		"token": "sometoken"
    75  	}
    76  }
    77  
    78  Ready, waiting for connections at https://127.0.0.1:48805
    79  ```
    80  
    81  To stop the `test-aci-auth-server` run stop command:
    82  ```
    83  $ ./test-aci-auth-server stop https://127.0.0.1:60268
    84  Response status: 200 OK
    85  ```