Skip to content

Commit

Permalink
Enable Golang-based Integration Tests (#590)
Browse files Browse the repository at this point in the history
* 🌟 enhancement(VSecM): convert bash tests to go

rewrite integration tests in go instead of bash

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* fix sentinel attestation

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* Hadooken 🤾‍♂️🔥

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* remove circular depdenceny

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* changes

* tests

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* transformation fix

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* fix

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* changes

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* minor

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* pass

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* cosmetic

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* test update

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* tests

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* missing EOL

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* update changelog

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* cleanup

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* fix wording

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* wording change.

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* minor

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* changelog update

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

---------

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>
  • Loading branch information
v0lkan authored Mar 4, 2024
1 parent efca70c commit b3977ec
Show file tree
Hide file tree
Showing 580 changed files with 4,661 additions and 3,431 deletions.
4 changes: 2 additions & 2 deletions .github/pull-request-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ Before you submit this PR, please make sure:
- [ ] You have thoroughly tested your changes.
- [ ] You have followed all the contributing guidelines for this project.
- [ ] You understand and agree that your contributions will be publicly available
under the projects license.
under the project's license.

[contributing]: https://vsecm.com/docs/contributing/
[test-policy]: https://vsecm.com/docs/contributing/#add-tests-for-new-features

*By submitting this pull request, you confirm that my contribution is made under
the terms of the projects license and that you have the authority to grant
the terms of the project's license and that you have the authority to grant
these rights.*

---
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# | Protect your secrets, protect your sensitive data.
# : Explore VMware Secrets Manager docs at https://vsecm.com/
# </
# <>/ keep your secrets secret
# <>/ keep your secrets... secret
# >/
# <>/' Copyright 2023present VMware Secrets Manager contributors.
# <>/' Copyright 2023-present VMware Secrets Manager contributors.
# >/' SPDX-License-Identifier: BSD-2-Clause
# */

Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# | Protect your secrets, protect your sensitive data.
# : Explore VMware Secrets Manager docs at https://vsecm.com/
# </
# <>/ keep your secrets secret
# <>/ keep your secrets... secret

# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.
Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
| Protect your secrets, protect your sensitive data.
: Explore VMware Secrets Manager docs at https://vsecm.com/
</
<>/ keep your secrets secret
<>/ keep your secrets... secret
```

# Contributor Covenant Code of Conduct
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
| Protect your secrets, protect your sensitive data.
: Explore VMware Secrets Manager docs at https://vsecm.com/
</
<>/ keep your secrets secret
<>/ keep your secrets... secret
```

## Contributing
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING_DCO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
| Protect your secrets, protect your sensitive data.
: Explore VMware Secrets Manager docs at https://vsecm.com/
</
<>/ keep your secrets secret
<>/ keep your secrets... secret
```

# Contributing to VMware Secrets Manager for Cloud-Native Apps
Expand Down Expand Up @@ -54,7 +54,7 @@ building, deploying, and testing **VMware Secrets Manager**.

The guide and other documentation is maintained at the `./docs` folder in this
repository. You are more than welcome to contribute to it if you find anything
thats missing or needs improvement.
that's missing or needs improvement.

In addition, please [follow the quickstart manual](https://vsecm.com/quickstart/)
that is specifically designed for you to experiment with **VMware Secrets Manager**
Expand All @@ -66,7 +66,7 @@ any errors before creating a pull request.

## Contribution Flow

This is a rough outline of what a contributors workflow looks like:
This is a rough outline of what a contributor's workflow looks like:

* Make a fork of the repository within your GitHub account
* Create a topic branch in your fork from where you want to base your work
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
| Protect your secrets, protect your sensitive data.
: Explore VMware Secrets Manager docs at https://vsecm.com/
</
<>/ keep your secrets secret
<>/ keep your secrets... secret
```

## Project Maintainers
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# | Protect your secrets, protect your sensitive data.
# : Explore VMware Secrets Manager docs at https://vsecm.com/
# </
# <>/ keep your secrets secret
# <>/ keep your secrets... secret
# >/
# <>/' Copyright 2023present VMware Secrets Manager contributors.
# <>/' Copyright 2023-present VMware Secrets Manager contributors.
# >/' SPDX-License-Identifier: BSD-2-Clause
# */

Expand Down
9 changes: 6 additions & 3 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Copyright 2023 present VMware Secrets Manager contributors.
Copyright 2023 - present VMware Secrets Manager contributors.

This product is licensed to you under the BSD 2 clause (the "License"). You may not use this product except in compliance with the License.
This product is licensed to you under the BSD 2 clause (the "License"). You may
not use this product except in compliance with the License.

This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file.
This product may include a number of subcomponents with separate copyright notices
and license terms. Your use of these subcomponents is subject to the terms and
conditions of the subcomponent's license, as noted in the LICENSE file.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
| Protect your secrets, protect your sensitive data.
: Explore VMware Secrets Manager docs at https://vsecm.com/
</
<>/ keep your secrets secret
<>/ keep your secrets... secret
```

## The Elevator Pitch
Expand Down Expand Up @@ -52,8 +52,8 @@ Before trying **VMware Secrets Manager**, you might want to learn about its

Once you are ready to start, [see the Quickstart guide][quickstart].

Or, if you are one of those who *learn by doing*, you might want to dig into the
implementation details later. If thats the case, you can directly jump to the
Or, if you are one of those who "*learn by doing*", you might want to dig into the
implementation details later. If that's the case, you can directly jump to the
fun part and [follow the steps here][installation] to install
**VMware Secrets Manager** to your Kubernetes cluster.

Expand Down Expand Up @@ -82,18 +82,18 @@ the future of **VMware Secrets Manager** looks like.

**VMware Secrets Manager** is under dynamic and progressive development.

The code weve officially signed and released maintains a
The code we've officially signed and released maintains a
high standard of stability and dependability. However, we do encourage
it to be used in a production environment (*at your own risk[see LICENSE](LICENSE)*).
it to be used in a production environment (*at your own risk--[see LICENSE](LICENSE)*).

Its important to note that, technically speaking, **VMware Secrets Manager**
It's important to note that, technically speaking, **VMware Secrets Manager**
currently holds the status of an *alpha software*. This means that as we
journey towards our milestone of `v1.0.0`, it's possible for changes to
occurboth major and minor. While this might mean some aspects are not backward
occur--both major and minor. While this might mean some aspects are not backward
compatible, it's a testament to our unwavering commitment to refining and
enhancing **VMware Secrets Manager**.

In a nutshell, we are ceaselessly pushing the boundaries of whats possible while
In a nutshell, we are ceaselessly pushing the boundaries of what's possible while
ensuring our software stays dependable and effective for production use.

## 🦆🦆🦆 (*Docs*)
Expand All @@ -102,7 +102,7 @@ ensuring our software stays dependable and effective for production use.

## A Note on Security

We take **VMware Secrets Manager**s security seriously. If you believe you have
We take **VMware Secrets Manager**'s security seriously. If you believe you have
found a vulnerability, please [**follow this guideline**][vuln]
to responsibly disclose it.

Expand All @@ -120,7 +120,7 @@ to responsibly disclose it.
Open Source is better together.

If you are a security enthusiast,
[**join VMware Secrets Managers Slack Workspace**][slack-invite]
[**join VMware Secrets Manager's Slack Workspace**][slack-invite]
and let us change the world together 🤘.

## Links
Expand All @@ -129,7 +129,7 @@ and let us change the world together 🤘.

* **Homepage and Docs**: <https://vsecm.com/>
* **Changelog**: <https://vsecm.com/docs/changelog/>
* **Community**: [Join **VSecM**s Slack Workspace][slack-invite]
* **Community**: [Join **VSecM**'s Slack Workspace][slack-invite]
* **Contact**: <https://vsecm.com/docs/community/>

### Guides and Tutorials
Expand Down Expand Up @@ -172,11 +172,11 @@ of **VMware Secrets Manager** system design and how each component fits together

## Folder Structure

> *VSecM* == VMware Secrets Manager for Cloud-Native Apps
> *VSecM* == "VMware Secrets Manager for Cloud-Native Apps"
Here are the important folders and files in this repository:

* `./app`: Contains core **VSecM** components source code.
* `./app`: Contains core **VSecM** components' source code.
* `./app/init-container`: Contains the source code for the **VSecM Init Container**.
* `./app/safe`: Contains the **VSecM Safe** source code.
* `./app/sentinel`: Contains the source code for the **VSecM Sentinel**.
Expand All @@ -200,11 +200,11 @@ Here are the important folders and files in this repository:
## Changelog

You can find the changelog and migration/upgrade instructions (*if any*)
on [**VMware Secrets Manager**s Changelog Page](https://vsecm.com/docs/changelog/).
on [**VMware Secrets Manager**'s Changelog Page](https://vsecm.com/docs/changelog/).

## Whats Coming Up Next?
## What's Coming Up Next?

You can see the projects progress [in this **VMware Secrets Manager** roadmap][mdp].
You can see the project's progress [in this **VMware Secrets Manager** roadmap][mdp].

[mdp]: https://vsecm.com/docs/roadmap/

Expand Down Expand Up @@ -232,7 +232,7 @@ of maintainers of **VMware Secrets Manager**.
Please send your feedback, suggestions, recommendations, and comments to
[feedback@vsecm.com](mailto:feedback@vsecm.com).

Wed love to have them.
We'd love to have them.

## License

Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
| Protect your secrets, protect your sensitive data.
: Explore VMware Secrets Manager docs at https://vsecm.com/
</
<>/ keep your secrets secret
<>/ keep your secrets... secret
```

## About
Expand All @@ -27,7 +27,7 @@ and we will also have a support plan various major versions.

Send your vulnerability reports to [security@vsecm.com](mailto:security@vsecm.com).

We dont have an official turnover time, but if nobody gets back
We don't have an official turnover time, but if nobody gets back
to you within a week please send another email.

We take all vulnerability reports seriously, and you will be notified
Expand Down
2 changes: 1 addition & 1 deletion app/init-container/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
| Protect your secrets, protect your sensitive data.
: Explore VMware Secrets Manager docs at https://vsecm.com/
</
<>/ keep your secrets secret
<>/ keep your secrets... secret
```

## VMware Secrets Manager (*VSecM*) Init Container
Expand Down
7 changes: 4 additions & 3 deletions app/init-container/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
| Protect your secrets, protect your sensitive data.
: Explore VMware Secrets Manager docs at https://vsecm.com/
</
<>/ keep your secrets secret
<>/ keep your secrets... secret
>/
<>/' Copyright 2023present VMware Secrets Manager contributors.
<>/' Copyright 2023-present VMware Secrets Manager contributors.
>/' SPDX-License-Identifier: BSD-2-Clause
*/

Expand All @@ -23,7 +23,8 @@ func main() {
go startup.Watch()

//Print the diagnostic information about the environment.
envVarsToPrint := []string{"APP_VERSION", "VSECM_LOG_LEVEL", "VSECM_SAFE_ENDPOINT_URL"}
envVarsToPrint := []string{"APP_VERSION", "VSECM_LOG_LEVEL",
"VSECM_SAFE_ENDPOINT_URL"}
log.PrintEnvironmentInfo(&id, envVarsToPrint)

// Block the process from exiting, but also be graceful and honor the
Expand Down
4 changes: 2 additions & 2 deletions app/keygen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
| Protect your secrets, protect your sensitive data.
: Explore VMware Secrets Manager docs at https://vsecm.com/
</
<>/ keep your secrets secret
<>/ keep your secrets... secret
```

## VMware Secrets Manager (VSecM) Keygen

**VSecM Keygen** is a utility application that generates VSecM Safes
**VSecM Keygen** is a utility application that generates VSecM Safe's
bootstrapping keys if you want an extra level of security and control the
creation of the **root key** yourself (*instead of letting VSecM Safe generate
it for you*).
Expand Down
25 changes: 13 additions & 12 deletions app/keygen/cmd/decrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
| Protect your secrets, protect your sensitive data.
: Explore VMware Secrets Manager docs at https://vsecm.com/
</
<>/ keep your secrets secret
<>/ keep your secrets... secret
>/
<>/' Copyright 2023present VMware Secrets Manager contributors.
<>/' Copyright 2023-present VMware Secrets Manager contributors.
>/' SPDX-License-Identifier: BSD-2-Clause
*/

Expand All @@ -14,12 +14,13 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
"github.com/vmware-tanzu/secrets-manager/core/crypto"
entity "github.com/vmware-tanzu/secrets-manager/core/entity/reqres/safe/v1"
"github.com/vmware-tanzu/secrets-manager/core/env"
"log"
"os"
"strings"

"github.com/vmware-tanzu/secrets-manager/core/crypto"
entity "github.com/vmware-tanzu/secrets-manager/core/entity/reqres/safe/v1"
"github.com/vmware-tanzu/secrets-manager/core/env"
)

func rootKeyTriplet(content string) (string, string, string) {
Expand Down Expand Up @@ -99,24 +100,24 @@ func printDecryptedKeys() {

algorithm := ss.Algorithm

fmt.Println("Algorithm:", algorithm)
fmt.Println("---")
println("Algorithm:", algorithm)
println("---")
for _, secret := range ss.Secrets {
fmt.Println("Name:", secret.Name)
println("Name:", secret.Name)

values := secret.EncryptedValue

for i, v := range values {
dv, err := decrypt([]byte(v), algorithm)
if err != nil {
fmt.Println("Error decrypting value:", err.Error())
println("Error decrypting value:", err.Error())
continue
}
fmt.Printf("Value[%d]: %s\n", i, dv)
}

fmt.Println("Created:", secret.Created)
fmt.Println("Updated:", secret.Updated)
fmt.Println("---")
println("Created:", secret.Created)
println("Updated:", secret.Updated)
println("---")
}
}
4 changes: 2 additions & 2 deletions app/keygen/cmd/decrypt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
| Protect your secrets, protect your sensitive data.
: Explore VMware Secrets Manager docs at https://vsecm.com/
</
<>/ keep your secrets secret
<>/ keep your secrets... secret
>/
<>/' Copyright 2023present VMware Secrets Manager contributors.
<>/' Copyright 2023-present VMware Secrets Manager contributors.
>/' SPDX-License-Identifier: BSD-2-Clause
*/

Expand Down
15 changes: 7 additions & 8 deletions app/keygen/cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,28 @@
| Protect your secrets, protect your sensitive data.
: Explore VMware Secrets Manager docs at https://vsecm.com/
</
<>/ keep your secrets secret
<>/ keep your secrets... secret
>/
<>/' Copyright 2023present VMware Secrets Manager contributors.
<>/' Copyright 2023-present VMware Secrets Manager contributors.
>/' SPDX-License-Identifier: BSD-2-Clause
*/

package main

import (
"fmt"
"github.com/vmware-tanzu/secrets-manager/core/crypto"
)

func printGeneratedKeys() {
privateKey, publicKey, aesSeed, err := crypto.GenerateKeys()

if err != nil {
fmt.Println("Failed to generate keys:")
fmt.Println(err.Error())
println("Failed to generate keys:")
println(err.Error())
return
}

fmt.Println()
fmt.Println(crypto.CombineKeys(privateKey, publicKey, aesSeed))
fmt.Println()
println()
println(crypto.CombineKeys(privateKey, publicKey, aesSeed))
println()
}
Loading

0 comments on commit b3977ec

Please sign in to comment.