private ModuleFields loadAuth ( URI relativeURI , String httpMethod ) { ModuleFields authFields = new ModuleFields ( ) ; for ( PipeModule module : modules ) { ModuleFields moduleFields = module . loadModule ( relativeURI , httpMethod , new byte [ ] { } ) ; if ( ! moduleFields . getHeaders ( ) . isEmpty ( ) ) { for ( Pair < String , String > header : moduleFields . getHeaders ( ) ) { authFields . addHeader ( header . first , header . second ) ; } } if ( ! moduleFields . getQueryParameters ( ) . isEmpty ( ) ) { for ( Pair < String , String > header : moduleFields . getQueryParameters ( ) ) { authFields . addQueryParameter ( header . first , header . second ) ; } } } return authFields ; }
Apply authentication if the token is present