aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpg9182 <96569817+pg9182@users.noreply.github.com>2023-02-27 00:40:46 -0500
committerpg9182 <96569817+pg9182@users.noreply.github.com>2023-03-04 00:49:32 -0500
commitf6f6703a6461e14d8e25f55ab846c18fd39adbe3 (patch)
tree84640bd4ea429195378932a6281f3d069aefa9cf
parentb0522c97465a3c0d49d2fe784a23e6fe8b908c6b (diff)
downloadAtlas-f6f6703a6461e14d8e25f55ab846c18fd39adbe3.tar.gz
Atlas-f6f6703a6461e14d8e25f55ab846c18fd39adbe3.zip
pkg/atlas: Add EAX username sources
-rw-r--r--pkg/atlas/config.go4
-rw-r--r--pkg/atlas/server.go8
2 files changed, 12 insertions, 0 deletions
diff --git a/pkg/atlas/config.go b/pkg/atlas/config.go
index 05bd2a6..a7cc8c2 100644
--- a/pkg/atlas/config.go
+++ b/pkg/atlas/config.go
@@ -164,6 +164,10 @@ type Config struct {
// is used if OriginEmail is provided, otherwise, "none" is used.
// - none (don't get usernames)
// - origin (get the username from the Origin API)
+ // - origin-eax (get the username from the Origin API, but fall back to EAX on failure)
+ // - origin-eax-debug (get the username from the Origin API, but also check EAX and warn if it's different)
+ // - eax (get the username from EAX)
+ // - eax-origin (get the username from EAX, but fall back to the Origin API on failure)
UsernameSource string `env:"ATLAS_USERNAMESOURCE"`
// The email address to use for Origin login. If not provided, the Origin
diff --git a/pkg/atlas/server.go b/pkg/atlas/server.go
index 8b32978..7475536 100644
--- a/pkg/atlas/server.go
+++ b/pkg/atlas/server.go
@@ -649,6 +649,14 @@ func configureUsernameSource(c *Config) (api0.UsernameSource, error) {
return api0.UsernameSourceNone, nil
case "origin":
return api0.UsernameSourceOrigin, nil
+ case "origin-eax":
+ return api0.UsernameSourceOriginEAX, nil
+ case "origin-eax-debug":
+ return api0.UsernameSourceOriginEAXDebug, nil
+ case "eax":
+ return api0.UsernameSourceEAX, nil
+ case "eax-origin":
+ return api0.UsernameSourceEAXOrigin, nil
case "":
// backwards compat
if c.OriginEmail != "" {