From f6f6703a6461e14d8e25f55ab846c18fd39adbe3 Mon Sep 17 00:00:00 2001 From: pg9182 <96569817+pg9182@users.noreply.github.com> Date: Mon, 27 Feb 2023 00:40:46 -0500 Subject: pkg/atlas: Add EAX username sources --- pkg/atlas/config.go | 4 ++++ pkg/atlas/server.go | 8 ++++++++ 2 files changed, 12 insertions(+) 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 != "" { -- cgit v1.2.3