File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/main/java/io/securecodebox/persistence/defectdojo/service Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 3535
3636import java .net .URI ;
3737import java .net .URISyntaxException ;
38+ import java .nio .charset .StandardCharsets ;
3839import java .util .*;
3940
4041abstract public class GenericDefectDojoService <T extends DefectDojoModel > {
@@ -64,6 +65,15 @@ public GenericDefectDojoService(DefectDojoConfig config) {
6465 private HttpHeaders getDefectDojoAuthorizationHeaders () {
6566 HttpHeaders headers = new HttpHeaders ();
6667 headers .set ("Authorization" , "Token " + this .defectDojoConfig .getApiKey ());
68+
69+ String username = System .getProperty ("http.proxyUser" , "" );
70+ String password = System .getProperty ("http.proxyPassword" , "" );
71+
72+ if (!username .isEmpty () || !password .isEmpty ()) {
73+ System .out .println ("Setting Proxy Auth Header..." );
74+ headers .set (HttpHeaders .PROXY_AUTHORIZATION , "Basic " + Base64 .getEncoder ().encodeToString ((username + ':' + password ).getBytes (StandardCharsets .UTF_8 )));
75+ }
76+
6777 return headers ;
6878 }
6979
You can’t perform that action at this time.
0 commit comments