-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/ubf adds proxy and dev setting #90
Conversation
WalkthroughThe recent updates focus on enhancing proxy configuration capabilities within the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- Sources/UBDevTools/DevTools.swift (2 hunks)
- Sources/UBDevTools/DevToolsView.swift (2 hunks)
- Sources/UBDevTools/ProxyDevTool.swift (1 hunks)
- Sources/UBFoundation/Networking/HTTPHeaderField.swift (1 hunks)
- Sources/UBFoundation/Networking/UBURLSession+Configuration.swift (2 hunks)
- Sources/UBFoundation/Networking/UBURLSession+Proxy.swift (1 hunks)
Files skipped from review due to trivial changes (1)
- Sources/UBFoundation/Networking/HTTPHeaderField.swift
Additional comments not posted (7)
Sources/UBFoundation/Networking/UBURLSession+Proxy.swift (1)
10-19
: Well-defined protocol for proxy configuration in URL sessions.Sources/UBDevTools/ProxyDevTool.swift (2)
11-18
: Proper use of singleton pattern and method implementation inUBDevToolsProxyHelper
.
20-26
:Proxy
struct correctly implements the proxy configuration protocol and extends functionality with domain-specific settings.Sources/UBDevTools/DevTools.swift (1)
46-50
: MethodsetupProxySettings
correctly integrates withUBDevToolsProxyHelper
and passes parameters effectively.Sources/UBFoundation/Networking/UBURLSession+Configuration.swift (2)
36-54
: Enhancements toinit
method correctly integrate proxy settings into the session configuration.
Line range hint
57-89
: Enhancements toapplyDefaultHeaders
method correctly handle proxy authorization headers based on provided credentials.Sources/UBDevTools/DevToolsView.swift (1)
153-161
: New UI elements for proxy settings inDevToolsView
provide a user-friendly way to configure and enable proxy settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sieht gut aus; wir haben im Weekly noch überlegt, dass wir eventuell eine Lösung brauchen, dass man das nicht 1x anschaltet und es dann immer auf dem Proxy bleibt. Wir haben folgende Varianten diskutiert:
- Proxy am nächsten Tag zurücksetzen (z.B.
proxyEnabledDate
setzen und beim nächsten App start prüfen und ggf. zurücksetzen) - Visueller Indicator, dass Proxy drin ist
Was meinst du?
@@ -150,6 +150,15 @@ public struct DevToolsView: View { | |||
CacheDevTools.clearCache(cache) | |||
} | |||
} | |||
Section(header: Text("Proxy settings")) { | |||
Toggle("Start Proxy", isOn: Binding(get: { Self.enableNetworkingProxySettings }, set: { Self.enableNetworkingProxySettings = $0 })) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Den Restart brauchen wir hier nicht, weil man sowieso Save and exit klickt, oder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Genau, hatte ich ursprünglich drin, bis ich den "Speichern" Button gesehen habe.
Sources/UBDevTools/DevTools.swift
Outdated
@@ -42,6 +43,12 @@ public enum UBDevTools { | |||
CacheDevTools.additionalCaches = caches | |||
} | |||
|
|||
public static func setupProxySettings(host: String, port: Int, username: String?, password: String?, proxiedDomains: [String]? = nil) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hier könnte man noch die default Argumente setzen (proxy.ubique.rocks, etc) oder als doc comments hinzufügen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Und dass man die friendlyDefaultSession
brauchen muss. Sonst brauchen wir ja häufig die sharedSession
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default values würde ich nicht, das ist ein öffentliches Repo. Ich mache mal ein bisschen Docs rein.
7a795f2
to
c778731
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- Sources/UBDevTools/DevTools.swift (2 hunks)
- Sources/UBDevTools/DevToolsView.swift (2 hunks)
- Sources/UBDevTools/ProxyDevTool.swift (1 hunks)
- Sources/UBFoundation/Networking/HTTPHeaderField.swift (1 hunks)
- Sources/UBFoundation/Networking/UBURLSession+Configuration.swift (2 hunks)
- Sources/UBFoundation/Networking/UBURLSession+Proxy.swift (1 hunks)
Files skipped from review as they are similar to previous changes (6)
- Sources/UBDevTools/DevTools.swift
- Sources/UBDevTools/DevToolsView.swift
- Sources/UBDevTools/ProxyDevTool.swift
- Sources/UBFoundation/Networking/HTTPHeaderField.swift
- Sources/UBFoundation/Networking/UBURLSession+Configuration.swift
- Sources/UBFoundation/Networking/UBURLSession+Proxy.swift
@@ -188,4 +197,13 @@ public struct DevToolsView: View { | |||
|
|||
@UBUserDefault(key: "io.openmobilemaps.debug.rastertiles.enabled", defaultValue: false) | |||
public static var mapRasterTilesDebugOverlay: Bool | |||
|
|||
@UBUserDefault(key: "ubkit.devtools.proxy.enabled.key", defaultValue: false) | |||
public static var enableNetworkingProxySettings: Bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damit man das nicht aus Versehen für immer laufe lässt, zwei Vorschläge:
- Lösung 1: Statt Bool ein Start-Date speichern und
enableNetworkingProxySettings
als startDate <24h definieren - Lösung 2: Einen Badge, Banner als Overlay über die App legen
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- Sources/UBDevTools/DevToolsView.swift (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- Sources/UBDevTools/DevToolsView.swift
Summary by CodeRabbit
New Features
DevToolsView
struct, including toggles and text fields for proxy configuration.Enhancements
UBURLSessionConfiguration
with aproxy
property and methods for proxy configuration.Documentation