@@ -35,42 +35,42 @@ The `noncompliant01.py` code `front_end` method simulates our front-end service
3535``` py 
3636#  SPDX-FileCopyrightText: OpenSSF project contributors
3737#  SPDX-License-Identifier: MIT
38- """  Non-compliant Code Example """ 
38+ """ Non-compliant Code Example""" 
39+ 
3940import  logging
4041import  unittest
41-   
42+ 
4243logging.basicConfig(encoding = " utf-8"  , level = logging.DEBUG )
43-   
44-   
44+ 
45+ 
4546def  front_end ():
46-     """ Dummy method demonstrating noncompliant  implementation""" 
47+     """ Simulating front end  implementation""" 
4748    #  A noncompliant implementation would typically hardcode server_config
4849    #  and load it from a project global python file or variable
4950    server_config =  {}
5051    server_config[" IP"  ] =  " 192.168.0.1" 
5152    server_config[" PORT"  ] =  " 192.168.0.1" 
5253    server_config[" USER"  ] =  " admin" 
5354    server_config[" PASS"  ] =  " SuperSecret123" 
54-   
55+ 
5556    #  it would then use the configuration
5657    logging.debug(" connecting to server IP %s "  , server_config[" IP"  ])
5758    logging.debug(" connecting to server PORT %s "  , server_config[" IP"  ])
5859    logging.debug(" connecting to server USER %s "  , server_config[" USER"  ])
5960    logging.debug(" connecting to server PASS %s "  , server_config[" PASS"  ])
60-   
61-   
61+ 
62+ 
6263class  TestSimulateDeployingFrontEnd (unittest .TestCase ):
6364    """ 
6465    Simulate the deployment starting the front_end to connect 
6566    to the backend 
6667    """  
67-   
68+ 
6869    def  test_front_end (self  ):
6970        """ Verifiy front_end implementation""" 
7071        front_end()
71-  
72-  
73-  
72+ 
73+ 
7474if  __name__  ==  " __main__"  :
7575    unittest.main()
7676``` 
@@ -94,11 +94,10 @@ The `compliant01.py` code is using a `config.ini` file that is created by the de
9494* [ compliant01.py] ( compliant01.py ) :* 
9595
9696``` python 
97- """  Compliant Code Example """ 
9897#  SPDX-FileCopyrightText: OpenSSF project contributors
9998#  SPDX-License-Identifier: MIT
10099"""  Compliant Code Example """ 
101- import  logging 
100+ 
102101from  pathlib import  Path
103102import  unittest
104103import  configparser
@@ -107,8 +106,7 @@ logging.basicConfig(encoding="utf-8", level=logging.DEBUG)
107106
108107
109108def  front_end (config_file_path : Path):
110-     """ Dummy method demonstrating noncompliant implementation""" 
111-     #  A compliant loads connection information from a well protect file
109+     """ Simulating front end implementation""" 
112110    _config =  configparser.ConfigParser()
113111    _config.read(config_file_path)
114112
0 commit comments