feat: add Linux OAuth adapters

Add a bounded libcurl transport with verified TLS, no redirects or retries, sanitized failures, binary-safe requests, and resolved-address enforcement for cleartext loopback traffic.

Add shell-free xdg-open launching and a one-shot IPv4 loopback callback receiver with strict HTTP/query parsing, deadlines, fixed callback path, and RAII cleanup. Token parsing, Secret Service, and Graph remain follow-up phases.
This commit is contained in:
2026-07-18 11:33:06 +01:00
parent dd6e02cb55
commit 295acbc125
12 changed files with 2095 additions and 28 deletions

View File

@@ -14,6 +14,7 @@ project(
inc = include_directories('include')
sqlite = dependency('sqlite3')
libcrypto = dependency('libcrypto')
libcurl = dependency('libcurl')
threads = dependency('threads')
nocal_sources = files(
'src/domain/calendar_transfer.cpp',
@@ -22,6 +23,8 @@ nocal_sources = files(
'src/domain/month_layout.cpp',
'src/storage/ics_store.cpp',
'src/storage/sync_cache.cpp',
'src/sync/curl_http.cpp',
'src/sync/desktop_oauth.cpp',
'src/sync/oauth.cpp',
'src/tui/Screen.cpp',
'src/tui/EventEditor.cpp',
@@ -29,9 +32,9 @@ nocal_sources = files(
'src/tui/TuiApp.cpp',
)
nocal_lib = static_library('nocal-core', nocal_sources, include_directories: inc,
dependencies: [sqlite, libcrypto])
dependencies: [sqlite, libcrypto, libcurl])
nocal_dep = declare_dependency(include_directories: inc, link_with: nocal_lib,
dependencies: [sqlite, libcrypto])
dependencies: [sqlite, libcrypto, libcurl])
nocal_executable = executable('nocal', 'src/main.cpp',
dependencies: nocal_dep, install: true)
@@ -54,6 +57,12 @@ test('oauth', oauth_tests)
oauth_security_tests = executable('oauth-security-tests',
'tests/oauth_security_tests.cpp', dependencies: nocal_dep)
test('oauth-security', oauth_security_tests)
curl_http_tests = executable('curl-http-tests', 'tests/curl_http_tests.cpp',
dependencies: [nocal_dep, threads])
test('curl-http', curl_http_tests)
desktop_oauth_tests = executable('desktop-oauth-tests',
'tests/desktop_oauth_tests.cpp', dependencies: [nocal_dep, threads])
test('desktop-oauth', desktop_oauth_tests)
tui_tests = executable('tui-tests', 'tests/tui_tests.cpp',
dependencies: nocal_dep)
test('tui', tui_tests)