mirror of
				https://git.collinwebdesigns.de/oscar.krause/fastapi-dls.git
				synced 2025-10-26 18:05:28 +03:00 
			
		
		
		
	test with "76 chars per line"
This commit is contained in:
		
							parent
							
								
									dc783e6518
								
							
						
					
					
						commit
						14f8b54752
					
				
							
								
								
									
										18
									
								
								app/main.py
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								app/main.py
									
									
									
									
									
								
							@ -7,6 +7,7 @@ from hashlib import sha256
 | 
				
			|||||||
from json import loads as json_loads, dumps as json_dumps
 | 
					from json import loads as json_loads, dumps as json_dumps
 | 
				
			||||||
from os import getenv as env
 | 
					from os import getenv as env
 | 
				
			||||||
from os.path import join, dirname
 | 
					from os.path import join, dirname
 | 
				
			||||||
 | 
					from textwrap import wrap
 | 
				
			||||||
from uuid import uuid4
 | 
					from uuid import uuid4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from dateutil.relativedelta import relativedelta
 | 
					from dateutil.relativedelta import relativedelta
 | 
				
			||||||
@ -470,8 +471,21 @@ async def leasing_v1_config_token(request: Request):
 | 
				
			|||||||
    my_jwt_encode_key = jwk.construct(my_si_private_key.pem().decode('utf-8'), algorithm=ALGORITHMS.RS256)
 | 
					    my_jwt_encode_key = jwk.construct(my_si_private_key.pem().decode('utf-8'), algorithm=ALGORITHMS.RS256)
 | 
				
			||||||
    config_token = jws.sign(payload, key=my_jwt_encode_key, headers=None, algorithm=ALGORITHMS.RS256)
 | 
					    config_token = jws.sign(payload, key=my_jwt_encode_key, headers=None, algorithm=ALGORITHMS.RS256)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    response_ca_chain = my_ca_certificate.pem().decode('utf-8').strip().replace('\n', '\r\n')
 | 
					    response_ca_chain = my_ca_certificate.pem().decode('utf-8').strip()  # .replace('\n', '\r\n')
 | 
				
			||||||
    response_si_certificate = my_si_certificate.pem().decode('utf-8').strip().replace('\n', '\r\n')
 | 
					    response_ca_chain = response_ca_chain.replace('-----BEGIN CERTIFICATE-----', '')
 | 
				
			||||||
 | 
					    response_ca_chain = response_ca_chain.replace('-----END CERTIFICATE-----', '')
 | 
				
			||||||
 | 
					    response_ca_chain = response_ca_chain.replace('\n', '')
 | 
				
			||||||
 | 
					    response_ca_chain = wrap(response_ca_chain, 76)
 | 
				
			||||||
 | 
					    response_ca_chain = '\r\n'.join(response_ca_chain)
 | 
				
			||||||
 | 
					    response_ca_chain = f'-----BEGIN CERTIFICATE-----\r\n{response_ca_chain}\r\n-----END CERTIFICATE-----'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    response_si_certificate = my_si_certificate.pem().decode('utf-8').strip()  # .replace('\n', '\r\n')
 | 
				
			||||||
 | 
					    response_si_certificate = response_si_certificate.replace('-----BEGIN CERTIFICATE-----', '')
 | 
				
			||||||
 | 
					    response_si_certificate = response_si_certificate.replace('-----END CERTIFICATE-----', '')
 | 
				
			||||||
 | 
					    response_si_certificate = response_si_certificate.replace('\n', '')
 | 
				
			||||||
 | 
					    response_si_certificate = wrap(response_si_certificate, 76)
 | 
				
			||||||
 | 
					    response_si_certificate = '\r\n'.join(response_si_certificate)
 | 
				
			||||||
 | 
					    response_si_certificate = f'-----BEGIN CERTIFICATE-----\r\n{response_si_certificate}\r\n-----END CERTIFICATE-----'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    response = {
 | 
					    response = {
 | 
				
			||||||
        "certificateConfiguration": {
 | 
					        "certificateConfiguration": {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user