@@ -87,6 +87,8 @@ public class BuildRequest {
8787
8888 private final String applicationDirectory ;
8989
90+ private final List <String > securityOptions ;
91+
9092 BuildRequest (ImageReference name , Function <Owner , TarArchive > applicationContent ) {
9193 Assert .notNull (name , "Name must not be null" );
9294 Assert .notNull (applicationContent , "ApplicationContent must not be null" );
@@ -109,13 +111,14 @@ public class BuildRequest {
109111 this .launchCache = null ;
110112 this .createdDate = null ;
111113 this .applicationDirectory = null ;
114+ this .securityOptions = null ;
112115 }
113116
114117 BuildRequest (ImageReference name , Function <Owner , TarArchive > applicationContent , ImageReference builder ,
115118 ImageReference runImage , Creator creator , Map <String , String > env , boolean cleanCache ,
116119 boolean verboseLogging , PullPolicy pullPolicy , boolean publish , List <BuildpackReference > buildpacks ,
117120 List <Binding > bindings , String network , List <ImageReference > tags , Cache buildWorkspace , Cache buildCache ,
118- Cache launchCache , Instant createdDate , String applicationDirectory ) {
121+ Cache launchCache , Instant createdDate , String applicationDirectory , List < String > securityOptions ) {
119122 this .name = name ;
120123 this .applicationContent = applicationContent ;
121124 this .builder = builder ;
@@ -135,6 +138,7 @@ public class BuildRequest {
135138 this .launchCache = launchCache ;
136139 this .createdDate = createdDate ;
137140 this .applicationDirectory = applicationDirectory ;
141+ this .securityOptions = securityOptions ;
138142 }
139143
140144 /**
@@ -147,7 +151,7 @@ public BuildRequest withBuilder(ImageReference builder) {
147151 return new BuildRequest (this .name , this .applicationContent , builder .inTaggedOrDigestForm (), this .runImage ,
148152 this .creator , this .env , this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish ,
149153 this .buildpacks , this .bindings , this .network , this .tags , this .buildWorkspace , this .buildCache ,
150- this .launchCache , this .createdDate , this .applicationDirectory );
154+ this .launchCache , this .createdDate , this .applicationDirectory , this . securityOptions );
151155 }
152156
153157 /**
@@ -159,7 +163,7 @@ public BuildRequest withRunImage(ImageReference runImageName) {
159163 return new BuildRequest (this .name , this .applicationContent , this .builder , runImageName .inTaggedOrDigestForm (),
160164 this .creator , this .env , this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish ,
161165 this .buildpacks , this .bindings , this .network , this .tags , this .buildWorkspace , this .buildCache ,
162- this .launchCache , this .createdDate , this .applicationDirectory );
166+ this .launchCache , this .createdDate , this .applicationDirectory , this . securityOptions );
163167 }
164168
165169 /**
@@ -172,7 +176,7 @@ public BuildRequest withCreator(Creator creator) {
172176 return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , creator , this .env ,
173177 this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
174178 this .network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
175- this .applicationDirectory );
179+ this .applicationDirectory , this . securityOptions );
176180 }
177181
178182 /**
@@ -189,7 +193,7 @@ public BuildRequest withEnv(String name, String value) {
189193 return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator ,
190194 Collections .unmodifiableMap (env ), this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish ,
191195 this .buildpacks , this .bindings , this .network , this .tags , this .buildWorkspace , this .buildCache ,
192- this .launchCache , this .createdDate , this .applicationDirectory );
196+ this .launchCache , this .createdDate , this .applicationDirectory , this . securityOptions );
193197 }
194198
195199 /**
@@ -204,7 +208,7 @@ public BuildRequest withEnv(Map<String, String> env) {
204208 return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator ,
205209 Collections .unmodifiableMap (updatedEnv ), this .cleanCache , this .verboseLogging , this .pullPolicy ,
206210 this .publish , this .buildpacks , this .bindings , this .network , this .tags , this .buildWorkspace ,
207- this .buildCache , this .launchCache , this .createdDate , this .applicationDirectory );
211+ this .buildCache , this .launchCache , this .createdDate , this .applicationDirectory , this . securityOptions );
208212 }
209213
210214 /**
@@ -216,7 +220,7 @@ public BuildRequest withCleanCache(boolean cleanCache) {
216220 return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
217221 cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
218222 this .network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
219- this .applicationDirectory );
223+ this .applicationDirectory , this . securityOptions );
220224 }
221225
222226 /**
@@ -228,7 +232,7 @@ public BuildRequest withVerboseLogging(boolean verboseLogging) {
228232 return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
229233 this .cleanCache , verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
230234 this .network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
231- this .applicationDirectory );
235+ this .applicationDirectory , this . securityOptions );
232236 }
233237
234238 /**
@@ -240,7 +244,7 @@ public BuildRequest withPullPolicy(PullPolicy pullPolicy) {
240244 return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
241245 this .cleanCache , this .verboseLogging , pullPolicy , this .publish , this .buildpacks , this .bindings ,
242246 this .network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
243- this .applicationDirectory );
247+ this .applicationDirectory , this . securityOptions );
244248 }
245249
246250 /**
@@ -252,7 +256,7 @@ public BuildRequest withPublish(boolean publish) {
252256 return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
253257 this .cleanCache , this .verboseLogging , this .pullPolicy , publish , this .buildpacks , this .bindings ,
254258 this .network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
255- this .applicationDirectory );
259+ this .applicationDirectory , this . securityOptions );
256260 }
257261
258262 /**
@@ -277,7 +281,7 @@ public BuildRequest withBuildpacks(List<BuildpackReference> buildpacks) {
277281 return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
278282 this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , buildpacks , this .bindings ,
279283 this .network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
280- this .applicationDirectory );
284+ this .applicationDirectory , this . securityOptions );
281285 }
282286
283287 /**
@@ -302,7 +306,7 @@ public BuildRequest withBindings(List<Binding> bindings) {
302306 return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
303307 this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , bindings ,
304308 this .network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
305- this .applicationDirectory );
309+ this .applicationDirectory , this . securityOptions );
306310 }
307311
308312 /**
@@ -315,7 +319,7 @@ public BuildRequest withNetwork(String network) {
315319 return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
316320 this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
317321 network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
318- this .applicationDirectory );
322+ this .applicationDirectory , this . securityOptions );
319323 }
320324
321325 /**
@@ -338,7 +342,7 @@ public BuildRequest withTags(List<ImageReference> tags) {
338342 return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
339343 this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
340344 this .network , tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
341- this .applicationDirectory );
345+ this .applicationDirectory , this . securityOptions );
342346 }
343347
344348 /**
@@ -351,7 +355,7 @@ public BuildRequest withBuildWorkspace(Cache buildWorkspace) {
351355 return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
352356 this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
353357 this .network , this .tags , buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
354- this .applicationDirectory );
358+ this .applicationDirectory , this . securityOptions );
355359 }
356360
357361 /**
@@ -364,7 +368,7 @@ public BuildRequest withBuildCache(Cache buildCache) {
364368 return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
365369 this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
366370 this .network , this .tags , this .buildWorkspace , buildCache , this .launchCache , this .createdDate ,
367- this .applicationDirectory );
371+ this .applicationDirectory , this . securityOptions );
368372 }
369373
370374 /**
@@ -377,7 +381,7 @@ public BuildRequest withLaunchCache(Cache launchCache) {
377381 return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
378382 this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
379383 this .network , this .tags , this .buildWorkspace , this .buildCache , launchCache , this .createdDate ,
380- this .applicationDirectory );
384+ this .applicationDirectory , this . securityOptions );
381385 }
382386
383387 /**
@@ -390,7 +394,7 @@ public BuildRequest withCreatedDate(String createdDate) {
390394 return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
391395 this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
392396 this .network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache ,
393- parseCreatedDate (createdDate ), this .applicationDirectory );
397+ parseCreatedDate (createdDate ), this .applicationDirectory , this . securityOptions );
394398 }
395399
396400 private Instant parseCreatedDate (String createdDate ) {
@@ -415,7 +419,20 @@ public BuildRequest withApplicationDirectory(String applicationDirectory) {
415419 return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
416420 this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
417421 this .network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
418- applicationDirectory );
422+ applicationDirectory , this .securityOptions );
423+ }
424+
425+ /**
426+ * Return a new {@link BuildRequest} with an updated security options.
427+ * @param securityOptions the security options
428+ * @return an updated build request
429+ */
430+ public BuildRequest withSecurityOptions (List <String > securityOptions ) {
431+ Assert .notNull (securityOptions , "SecurityOption must not be null" );
432+ return new BuildRequest (this .name , this .applicationContent , this .builder , this .runImage , this .creator , this .env ,
433+ this .cleanCache , this .verboseLogging , this .pullPolicy , this .publish , this .buildpacks , this .bindings ,
434+ this .network , this .tags , this .buildWorkspace , this .buildCache , this .launchCache , this .createdDate ,
435+ this .applicationDirectory , securityOptions );
419436 }
420437
421438 /**
@@ -571,6 +588,14 @@ public String getApplicationDirectory() {
571588 return this .applicationDirectory ;
572589 }
573590
591+ /**
592+ * Return the security options that should be used by the lifecycle.
593+ * @return the security options
594+ */
595+ public List <String > getSecurityOptions () {
596+ return this .securityOptions ;
597+ }
598+
574599 /**
575600 * Factory method to create a new {@link BuildRequest} from a JAR file.
576601 * @param jarFile the source jar file
0 commit comments