mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-02-12 16:52:51 +00:00
OSM client IDs/keys as repo secrets, more links on about/info screen.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -92,6 +92,7 @@ Thumbs.db
|
||||
# Secrets or signing keys (add if used)
|
||||
*.keystore
|
||||
.env
|
||||
lib/keys.dart
|
||||
|
||||
# ───────────────────────────────
|
||||
# For now - not targeting these
|
||||
|
||||
@@ -2,6 +2,32 @@
|
||||
//
|
||||
// NEVER commit real secrets to public repos. For open source, use keys.dart.example instead.
|
||||
|
||||
const String kOsmProdClientId = 'U8p_n6IjZfQiL1KtdiwbB0-o9nto6CAKz7LC2GifJzk'; // example - replace with real
|
||||
const String kOsmSandboxClientId = 'SBHWpWTKf31EdSiTApnah3Fj2rLnk2pEwBORlX0NyZI'; // example - replace with real
|
||||
import 'dart:io';
|
||||
|
||||
// Fallback client IDs for local development - replace with your own if building locally
|
||||
const String _kOsmProdClientIdFallback = ''; // Put your fallback production client ID here
|
||||
const String _kOsmSandboxClientIdFallback = ''; // Put your fallback sandbox client ID here
|
||||
|
||||
// Get client IDs from environment variables first, then fallback to constants
|
||||
String get kOsmProdClientId {
|
||||
final envValue = Platform.environment['OSM_PROD_CLIENTID'];
|
||||
if (envValue != null && envValue.isNotEmpty) {
|
||||
return envValue;
|
||||
}
|
||||
if (_kOsmProdClientIdFallback.isNotEmpty) {
|
||||
return _kOsmProdClientIdFallback;
|
||||
}
|
||||
throw Exception('OSM Production Client ID not configured. Set OSM_PROD_CLIENTID environment variable or configure fallback in keys.dart');
|
||||
}
|
||||
|
||||
String get kOsmSandboxClientId {
|
||||
final envValue = Platform.environment['OSM_SANDBOX_CLIENTID'];
|
||||
if (envValue != null && envValue.isNotEmpty) {
|
||||
return envValue;
|
||||
}
|
||||
if (_kOsmSandboxClientIdFallback.isNotEmpty) {
|
||||
return _kOsmSandboxClientIdFallback;
|
||||
}
|
||||
throw Exception('OSM Sandbox Client ID not configured. Set OSM_SANDBOX_CLIENTID environment variable or configure fallback in keys.dart');
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
// Example OSM OAuth key config
|
||||
const String kOsmProdClientId = 'YOUR_PROD_CLIENT_ID_HERE';
|
||||
const String kOsmSandboxClientId = 'YOUR_SANDBOX_CLIENT_ID_HERE';
|
||||
Reference in New Issue
Block a user