4
4
from saml2 .config import Config
5
5
from saml2 .sigver import security_context
6
6
7
- from satosa .metadata_creation .saml_metadata import create_signed_entities_descriptor
8
7
from ..metadata_creation .saml_metadata import create_entity_descriptors
8
+ from ..metadata_creation .saml_metadata import create_signed_entities_descriptor
9
9
from ..satosa_config import SATOSAConfig
10
10
11
11
@@ -16,16 +16,7 @@ def _get_security_context(key, cert):
16
16
return security_context (conf )
17
17
18
18
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 ):
29
20
"""
30
21
Generates SAML metadata for the given PROXY_CONF, signed with the given KEY and associated CERT.
31
22
"""
@@ -42,3 +33,16 @@ def construct_saml_metadata(proxy_conf, key, cert, dir, valid):
42
33
print ("Writing metadata to '{}'" .format (path ))
43
34
with open (path , "w" ) as f :
44
35
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