Files
tatlock-ui/lib/features/control_room/npm/domain/entities/proxy_host.dart
T
Jeroen SchweitzerandClaude Opus 4.5 6989241ae7 chore: upgrade to riverpod 3.x and freezed 3.x
- Upgrade flutter_riverpod to 3.1.0, riverpod_annotation to 4.0.0
- Upgrade freezed to 3.2.3, freezed_annotation to 3.1.0
- Migrate freezed classes to use sealed keyword (freezed 3.x)
- Update provider naming (*NotifierProvider → *Provider)
- Add legacy.dart import for StateNotifierProvider compatibility
- Fix valueOrNull → value for AsyncValue
- Remove unused imports and fields
- Add sync from Authentik button to users/groups pages
- Suppress invalid_annotation_target warning in analysis_options

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 00:07:01 +01:00

94 lines
2.2 KiB
Dart

import 'package:freezed_annotation/freezed_annotation.dart';
part 'proxy_host.freezed.dart';
/// NPM proxy host entity representing a domain configuration.
@freezed
sealed class ProxyHost with _$ProxyHost {
const factory ProxyHost({
/// Proxy host ID.
required int id,
/// Domain names (can have multiple).
required List<String> domainNames,
/// Forward scheme (http or https).
required String forwardScheme,
/// Forward host (IP or hostname).
required String forwardHost,
/// Forward port.
required int forwardPort,
/// Whether SSL is enabled.
required bool sslEnabled,
/// SSL certificate ID (if enabled).
int? certificateId,
/// Whether the host is enabled.
@Default(true) bool enabled,
/// Whether HTTP/2 is enabled.
@Default(false) bool http2Support,
/// Whether HSTS is enabled.
@Default(false) bool hstsEnabled,
/// Whether to force SSL.
@Default(false) bool forceSSL,
/// Custom locations (advanced nginx config).
@Default([]) List<ProxyLocation> locations,
/// Access list ID (for auth).
int? accessListId,
/// Cache assets enabled.
@Default(false) bool cacheAssets,
/// Block common exploits.
@Default(false) bool blockExploits,
/// Websocket support.
@Default(false) bool websocketSupport,
/// Created timestamp.
DateTime? createdAt,
/// Modified timestamp.
DateTime? modifiedAt,
}) = _ProxyHost;
const ProxyHost._();
/// Primary domain (first in list).
String get primaryDomain =>
domainNames.isNotEmpty ? domainNames.first : 'Unknown';
/// Forward URL (scheme://host:port).
String get forwardUrl => '$forwardScheme://$forwardHost:$forwardPort';
/// SSL status label.
String get sslStatus => sslEnabled ? 'SSL Enabled' : 'No SSL';
}
/// Proxy location for advanced routing.
@freezed
sealed class ProxyLocation with _$ProxyLocation {
const factory ProxyLocation({
/// Location path.
required String path,
/// Forward scheme.
required String forwardScheme,
/// Forward host.
required String forwardHost,
/// Forward port.
required int forwardPort,
}) = _ProxyLocation;
}