-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(image): pull otp and super_gluu configuration from secrets
- Loading branch information
Showing
2 changed files
with
29 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import os | ||
|
||
from jans.pycloudlib import get_manager | ||
|
||
import logging.config | ||
from settings import LOGGING_CONFIG | ||
|
||
logging.config.dictConfig(LOGGING_CONFIG) | ||
logger = logging.getLogger("entrypoint") | ||
|
||
|
||
manager = get_manager() | ||
|
||
|
||
def pull_auth_conf(): | ||
conf_files = ( | ||
"otp_configuration.json", | ||
"super_gluu_creds.json", | ||
) | ||
for conf_file in conf_files: | ||
file_ = f"/etc/certs/{conf_file}" | ||
secret_name = os.path.splitext(conf_file)[0] | ||
logger.info(f"Pulling {file_} from secrets") | ||
manager.secret.to_file(secret_name, file_) | ||
|
||
|
||
if __name__ == "__main__": | ||
pull_auth_conf() |
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