obs-studio/UI/cmake/feature-youtube.cmake
Ryan Foster 3239e2a1f2 UI: Restrict regex pattern for OAuth secrets
The current regex pattern will successfully match if the cache variable
contains the pattern anywhere inside the string. Let's restrict the
regex pattern such that it requires the pattern to be precisely between
the beginning and end of the string with no other characters in between
those anchor points.
2023-09-06 15:06:59 -04:00

22 lines
733 B
CMake

if(YOUTUBE_CLIENTID
AND YOUTUBE_SECRET
AND YOUTUBE_CLIENTID_HASH MATCHES "^(0|[a-fA-F0-9]+)$"
AND YOUTUBE_SECRET_HASH MATCHES "^(0|[a-fA-F0-9]+)$")
target_sources(
obs-studio
PRIVATE # cmake-format: sortable
auth-youtube.cpp
auth-youtube.hpp
window-dock-youtube-app.cpp
window-dock-youtube-app.hpp
window-youtube-actions.cpp
window-youtube-actions.hpp
youtube-api-wrappers.cpp
youtube-api-wrappers.hpp)
target_enable_feature(obs-studio "YouTube API connection" YOUTUBE_ENABLED)
else()
target_disable_feature(obs-studio "YouTube API connection")
set(YOUTUBE_SECRET_HASH 0)
set(YOUTUBE_CLIENTID_HASH 0)
endif()