-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API key - check for Google or Bing layers without an API key
- Loading branch information
Showing
9 changed files
with
1,507 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
__copyright__ = 'Copyright 2024, 3Liz' | ||
__license__ = 'GPL version 3' | ||
__email__ = '[email protected]' | ||
|
||
import os | ||
|
||
from lizmap_server.tools import to_bool | ||
|
||
GOOGLE_KEY = 'GOOGLE' | ||
BING_KEY = 'BING' | ||
|
||
GOOGLE_DOMAIN = 'google.com' | ||
BING_DOMAIN = 'virtualearth.net' | ||
|
||
|
||
def strict_tos_check_key(provider: str) -> str: | ||
""" Check the environment variable for this provider. """ | ||
return f'STRICT_{provider}_TOS_CHECK' | ||
|
||
|
||
def strict_tos_check(provider: str) -> bool: | ||
""" Check the environment variable for this provider. """ | ||
env = os.getenv(strict_tos_check_key(provider)) | ||
if env is None: | ||
env = True | ||
return to_bool(env) |
Oops, something went wrong.