Skip to content

Commit

Permalink
add sigstore.duration to ease tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hboutemy committed Apr 17, 2023
1 parent 8aa9dc1 commit 7256c18
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -81,6 +82,12 @@ public class SigstoreSignAttachedMojo
@Parameter( property = "sigstore.wait", defaultValue = "0" )
private long wait;

/**
* PoC: certificate duration (in min)
*/
@Parameter( property = "sigstore.duration", defaultValue = "-1" )
private long duration;

/**
* Maven ProjectHelper
*/
Expand Down Expand Up @@ -185,6 +192,13 @@ else if ( project.getAttachedArtifacts().isEmpty() )
try
{
KeylessSigner signer = KeylessSigner.builder().sigstoreStagingDefaults().build();
if ( duration > -1 )
{
getLog().info( "updating certificate duration to " + duration + " min" );
signer = KeylessSigner.builder().sigstoreStagingDefaults()
.minSigningCertificateLifetime( Duration.ofMinutes( duration ) ).build();
}

for ( SigningBundle bundleToSign : filesToSign )
{
if ( wait > 0 )
Expand Down

0 comments on commit 7256c18

Please sign in to comment.