mirror of
				https://gitlab.crans.org/bde/nk20-scripts
				synced 2025-10-31 15:09:59 +01:00 
			
		
		
		
	oauth script
This commit is contained in:
		
							
								
								
									
										15
									
								
								shell/oauth2_latency
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										15
									
								
								shell/oauth2_latency
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| #!/usr/bin/sh | ||||
| # Copyright (C) 2018-2025 by BDE ENS-Paris-Saclay | ||||
| # SPDX-License-Identifier: GPL-3.0-or-later | ||||
|  | ||||
| # use this script for reduce latency with oauth2_provider (cf. https://gitlab.crans.org/bde/nk20/issues/134) | ||||
|  | ||||
| # Tested with django-oauth2-toolkit version 3.0.1 | ||||
|  | ||||
| sed -i -e "s/get_all_scopes()/get_all_scopes(scopes=scopes)/g" /var/www/note_kfet/env/lib/python3.11/site-packages/oauth2_provider/views/base.py | ||||
|  | ||||
| sed -i -e '/get_all_scopes()/{N;s/\(.*\)\n\(.*\)/\2\n\1/;s/get_all_scopes()/get_all_scopes(scopes=token_scopes)/}' /var/www/note_kfet/env/lib/python3.11/site-packages/oauth2_provider/models.py | ||||
|  | ||||
| sed -i -e '/get_all_scopes()/{N;s/\(.*\)\n\(.*\)/\2\n\1/;s/get_all_scopes()/get_all_scopes(scopes=read_write_scopes)/}' /var/www/note_kfet/env/lib/python3.11/site-packages/oauth2_provider/views/mixins.py | ||||
|  | ||||
| sed -i -e '/get_all_scopes()/{N;s/\(.*\)\n\(.*\)/\2\n\1/;s/get_all_scopes()/get_all_scopes(scopes=read_write_scopes)/}' /var/www/note_kfet/env/lib/python3.11/site-packages/oauth2_provider/decorators.py | ||||
		Reference in New Issue
	
	Block a user