44from saml2 .config import Config
55from saml2 .sigver import security_context
66
7- from satosa .metadata_creation .saml_metadata import create_signed_entities_descriptor
87from ..metadata_creation .saml_metadata import create_entity_descriptors
8+ from ..metadata_creation .saml_metadata import create_signed_entities_descriptor
99from ..satosa_config import SATOSAConfig
1010
1111
@@ -16,16 +16,7 @@ def _get_security_context(key, cert):
1616 return security_context (conf )
1717
1818
19- @click .command ()
20- @click .argument ("proxy_conf" )
21- @click .argument ("key" )
22- @click .argument ("cert" )
23- @click .option ("--dir" ,
24- type = click .Path (exists = True , file_okay = False , dir_okay = True , writable = True , readable = False ,
25- resolve_path = False ),
26- default = "." , help = "Where the output files should be written." )
27- @click .option ("--valid" , type = click .INT , default = None , help = "Number of hours the metadata should be valid." )
28- def construct_saml_metadata (proxy_conf , key , cert , dir , valid ):
19+ def create_and_write_saml_metadata (proxy_conf , key , cert , dir , valid ):
2920 """
3021 Generates SAML metadata for the given PROXY_CONF, signed with the given KEY and associated CERT.
3122 """
@@ -42,3 +33,16 @@ def construct_saml_metadata(proxy_conf, key, cert, dir, valid):
4233 print ("Writing metadata to '{}'" .format (path ))
4334 with open (path , "w" ) as f :
4435 f .write (metadata )
36+
37+
38+ @click .command ()
39+ @click .argument ("proxy_conf" )
40+ @click .argument ("key" )
41+ @click .argument ("cert" )
42+ @click .option ("--dir" ,
43+ type = click .Path (exists = True , file_okay = False , dir_okay = True , writable = True , readable = False ,
44+ resolve_path = False ),
45+ default = "." , help = "Where the output files should be written." )
46+ @click .option ("--valid" , type = click .INT , default = None , help = "Number of hours the metadata should be valid." )
47+ def construct_saml_metadata (proxy_conf , key , cert , dir , valid ):
48+ create_and_write_saml_metadata (proxy_conf , key , cert , dir , valid )
0 commit comments