mirror of
https://github.com/FairwindsOps/polaris.git
synced 2026-05-08 02:06:53 +00:00
* add login flow * add logout functionality * improve code * implement token and status print * implement status command * add user to login * improve server port management * improve login flow * fix login flow * make insights URL for login configurable * remove comments * fix logrus directive usage * add upload-insights command * remove unnecessary usage of pointer * error when using upload-insights and audit-path simultaneously * upload-insights support * set priority to reports * adds report verification * fix logging to meet expected results * renaming variable name * improve results printing * improve variable naming * remove TODO * Update checks severities (#950) * change all ignore checks to warning * promoting checks initially warning that should be danger. * fixing docs and examples * adds changelog * fix changelog version * improve general error message * update workloads to be able grab its version * print URL on stdout on browser error * use os.WriteFile instead of low-level API * renaming fn params * add insights client * validating token on auth status * minor fix * only query for re-auth if token is still valid * update some dependencies in go and CI (#951) * update some dependencies * update testing requirements * Fix cert-manager * lots of deprecated versions * attempts * review suggestions * avoid nil pointer * fix fixtures * fix test --------- Co-authored-by: Robert Brennan <contact@rbren.io> * update changelog --------- Co-authored-by: Andrew Suderman <andy@fairwinds.com> Co-authored-by: Robert Brennan <contact@rbren.io>
21 lines
349 B
Go
21 lines
349 B
Go
package auth
|
|
|
|
import "fmt"
|
|
|
|
func PrintToken() error {
|
|
if content, err := readPolarisHostsFile(); err == nil {
|
|
if len(content) > 0 {
|
|
for k, h := range content {
|
|
if len(content) == 1 {
|
|
fmt.Println(h.Token)
|
|
} else {
|
|
fmt.Printf("%s: %s\n", k, h.Token)
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
}
|
|
fmt.Println("no oauth token")
|
|
return nil
|
|
}
|