Skip to content

Commit

Permalink
CL-522 | include more job properties available for filters
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriela S. Soria <[email protected]>
  • Loading branch information
gsoria committed Apr 28, 2023
1 parent ac274c9 commit 2fae9cc
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions resources/signer.signingjobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package resources

import (
"fmt"
"time"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
Expand All @@ -10,10 +11,17 @@ import (
)

type SignerSigningJob struct {
svc *signer.Signer
jobId *string
reason string
isRevoked *bool
svc *signer.Signer
jobId *string
reason string
isRevoked *bool
createdAt time.Time
profileName *string
profileVersion *string
platformId *string
platformDisplayName *string
jobOwner *string
jobInvoker *string
}

func init() {
Expand All @@ -30,10 +38,17 @@ func ListSignerSigningJobs(sess *session.Session) ([]Resource, error) {
err := svc.ListSigningJobsPages(listJobsInput, func(page *signer.ListSigningJobsOutput, lastPage bool) bool {
for _, job := range page.Jobs {
resources = append(resources, &SignerSigningJob{
svc: svc,
jobId: job.JobId,
reason: reason,
isRevoked: job.IsRevoked,
svc: svc,
jobId: job.JobId,
reason: reason,
isRevoked: job.IsRevoked,
createdAt: *job.CreatedAt,
profileName: job.ProfileName,
profileVersion: job.ProfileVersion,
platformId: job.PlatformId,
platformDisplayName: job.PlatformDisplayName,
jobOwner: job.JobOwner,
jobInvoker: job.JobInvoker,
})
}
return true // continue iterating over pages
Expand Down Expand Up @@ -67,5 +82,12 @@ func (j *SignerSigningJob) Remove() error {
func (j *SignerSigningJob) Properties() types.Properties {
properties := types.NewProperties()
properties.Set("JobId", j.jobId)
properties.Set("CreatedAt", j.createdAt.Format(time.RFC3339))
properties.Set("ProfileName", j.profileName)
properties.Set("ProfileVersion", j.profileVersion)
properties.Set("PlatformId", j.platformId)
properties.Set("PlatformDisplayName", j.platformDisplayName)
properties.Set("JobOwner", j.jobOwner)
properties.Set("JobInvoker", j.jobInvoker)
return properties
}

0 comments on commit 2fae9cc

Please sign in to comment.