Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add field name in the Policy #209

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion policy/policy.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 The Witness Contributors
// Copyright 2021-2024 The Witness Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -36,6 +36,7 @@ const PolicyPredicate = "https://witness.testifysec.com/policy/v0.1"
// +kubebuilder:object:generate=true
type Policy struct {
Expires metav1.Time `json:"expires"`
Name string `json:"name,omitempty"`
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it have some constraints?
i.e. ([A-Za-z0-9\-\_]+)

Roots map[string]Root `json:"roots,omitempty"`
TimestampAuthorities map[string]Root `json:"timestampauthorities,omitempty"`
PublicKeys map[string]PublicKey `json:"publickeys,omitempty"`
Expand Down
3 changes: 2 additions & 1 deletion policy/policy_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 The Witness Contributors
// Copyright 2021-2024 The Witness Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -101,6 +101,7 @@ deny[msg] {
Key: pubKeyPem2,
},
},
Name: "test-v1",
Steps: map[string]Step{
"step1": {
Name: "step1",
Expand Down