summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.md3
-rw-r--r--internal/api/profiles/profiles.go1
-rw-r--r--types/server/server.go3
3 files changed, 7 insertions, 0 deletions
diff --git a/CHANGES.md b/CHANGES.md
index 1925509..aaaf0ea 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,3 +1,6 @@
+# Not released
+* Expose default gateway in profile settings too. For clients, use the default gateway set on the config object, this is maybe only useful for suggesting some profiles in the client profile chooser UI
+
# 1.99.1 (2024-03-11)
* Disable type annotation for global eduVPN class as it gave a `SyntaxError` on some Python versions. See https://bugs.python.org/issue34939
diff --git a/internal/api/profiles/profiles.go b/internal/api/profiles/profiles.go
index d31bbcc..1df17e3 100644
--- a/internal/api/profiles/profiles.go
+++ b/internal/api/profiles/profiles.go
@@ -123,6 +123,7 @@ func (i Info) Public() server.Profiles {
DisplayName: map[string]string{
"en": p.DisplayName,
},
+ DefaultGateway: p.DefaultGateway,
}
}
return server.Profiles{Map: m}
diff --git a/types/server/server.go b/types/server/server.go
index 260d328..1d55ea7 100644
--- a/types/server/server.go
+++ b/types/server/server.go
@@ -86,6 +86,9 @@ type Profile struct {
// E.g. {"en": "Default Profile"}
// If this is empty, the field is omitted from the JSON
DisplayName map[string]string `json:"display_name,omitempty"`
+
+ // DefaultGateway is true when the profile is a default gateway one
+ DefaultGateway bool `json:"default_gateway"`
}
// Profiles is the map of profiles with the current defined