We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class _Format(object): def __init__(self, fmt_str): self.fmt_str = fmt_str def glomit(self, target, scope): return self.fmt_str.format(**target)
motivating use case: generating a SAML IDP config as needed by pysaml2:
_SAML_IDP_CONFIG = Fill({ 'debug': T['debug'], 'xmlsec_binary': saml2.sigver.get_xmlsec_binary(['/opt/local/bin', '/usr/bin/xmlsec1']), 'entityid': T['entity_id'], 'description': 'EBill/Tableau IdP', 'service': { 'idp': { 'name': 'Ebill IdP', 'endpoints': { 'single_sign_on_service': [ (_Format('{base_url}/sso/post/'), saml2.BINDING_HTTP_POST), (_Format('{base_url}/sso/redirect/'), saml2.BINDING_HTTP_REDIRECT), ], }, 'name_id_format': [saml2.saml.NAMEID_FORMAT_EMAILADDRESS], 'sign_response': False, 'sign_assertion': True, }, }, 'metadata': { 'local': [T['metadata']], }, # Signing 'key_file': _Format('{cert_dir}/private.key'), 'cert_file': _Format('{cert_dir}/public.cert'), # Encryption 'encryption_keypairs': [{ 'key_file': _Format('{cert_dir}/private.key'), 'cert_file': _Format('{cert_dir}/public.cert'), }], 'valid_for': 365 * 24, })
The text was updated successfully, but these errors were encountered:
maybe it could be made a BIT more general by taking a second argument of the dictionary which should be **'d into the format call (default T)
T
class _Format(object): def __init__(self, fmt_str, spec=T): self.fmt_str, self.spec = fmt_str, spec def glomit(self, target, scope): fmt_args = scope[glom](self.spec, target, scope) return self.fmt_str.format(**fmt_args)
Sorry, something went wrong.
#131
No branches or pull requests
motivating use case: generating a SAML IDP config as needed by pysaml2:
The text was updated successfully, but these errors were encountered: