capactio / capact

Simple way to manage applications and infrastructure.
https://capact.io
Apache License 2.0
80 stars 19 forks source link

Migrate context list to config storage #642

Closed mkuziemko closed 2 years ago

mkuziemko commented 2 years ago

Description

Changes proposed in this pull request:

Tests

  1. Get the list of contexts:
    $ ./bin/capact-linux-amd64 config get-contexts
    SERVER   AUTH TYPE   DEFAULT  
    ---------+-----------+----------
  2. Login to sample server:
    $ ./bin/capact-linux-amd64 login
    ? Gateway's server address:  localhost:8080
    ? Username:  test
    ? Password:  ****
    Login Succeeded
  3. Repeat step (1)
          SERVER           AUTH TYPE    DEFAULT  
    -------------------------+------------+----------
    https://localhost:8080   Basic Auth   NO  
  4. Repeat step (2) and (3)
    
    $ ./bin/capact-linux-amd64 login
    ? Gateway's server address:  test.com
    ? Username:  test
    ? Password:  ****
    Login Succeeded

$ ./bin/capact-linux-amd64 config get-contexts SERVER AUTH TYPE DEFAULT
-------------------------+------------+---------- https://localhost:8080 Basic Auth YES
https://test.com Basic Auth NO

5. Verify if the contexts exists in created config file:

availablecontexts: