#NEWLINE# @ Disp . register ( [ Authorization ] ) #NEWLINE# def _authorization( self , path , obj , app ) : #NEWLINE# #INDENT# o = objects . SecurityScheme ( NullContext ( ) ) #NEWLINE# if ( obj . type == 'basicAuth' ) : #NEWLINE# #INDENT# o . update_field ( 'type' , 'basic' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# o . update_field ( 'type' , obj . type ) #NEWLINE# #UNINDENT# o . update_field ( 'scopes' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# for s in ( obj . scopes or [ ] ) : #NEWLINE# #INDENT# o . scopes [ s . scope ] = s . description #NEWLINE# #UNINDENT# if ( o . type == 'oauth2' ) : #NEWLINE# #INDENT# o . update_field ( 'authorizationUrl' , get_or_none ( obj , 'grantTypes' , 'implicit' , 'loginEndpoint' , 'url' ) ) #NEWLINE# o . update_field ( 'tokenUrl' , get_or_none ( obj , 'grantTypes' , 'authorization_code' , 'tokenEndpoint' , 'url' ) ) #NEWLINE# if o . authorizationUrl : #NEWLINE# #INDENT# o . update_field ( 'flow' , 'implicit' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if obj . tokenUrl : #NEWLINE# #INDENT# o . update_field ( 'flow' , 'access_code' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( o . type == 'apiKey' ) : #NEWLINE# #INDENT# o . update_field ( 'name' , obj . keyname ) #NEWLINE# o . update_field ( 'in' , obj . passAs ) #NEWLINE# #UNINDENT# #UNINDENT# self . __swagger . securityDefinitions [ obj . get_name ( path ) ] = o