Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dustinspecker/azure-go-secret-property-names
List of Azure Go SDK property names that are secret
https://github.com/dustinspecker/azure-go-secret-property-names
Last synced: 2 days ago
JSON representation
List of Azure Go SDK property names that are secret
- Host: GitHub
- URL: https://github.com/dustinspecker/azure-go-secret-property-names
- Owner: dustinspecker
- License: mit
- Created: 2024-05-15T02:37:26.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-05-15T03:44:16.000Z (6 months ago)
- Last Synced: 2024-06-19T11:15:06.420Z (5 months ago)
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# azure-go-secret-property-names
> List of Azure Go SDK property names that are secret
## Install
Install by running:
```sh
go get github.com/dustinspecker/azure-go-secret-property-names
```## Usage
### GetAll
`GetAll` returns every single secret property name.
```go
import (
"fmt""github.com/dustinspecker/azure-go-secret-property-names/secretnames"
)func main() {
// GetAll returns all Azure Go SDK secret property names
allSecretNames := secretnames.GetAll()fmt.Println(len(allSecretNames) > 0)
// Output:
// true
}
```### GetSubset
While using `GetAll`, you may decide there are a number of them that you don't believe are secret for your use cases.
`GetSubset` allows you to filter out the secret property names you don't believe are secret.
```go
import (
"fmt""github.com/dustinspecker/azure-go-secret-property-names/secretnames"
)func main() {
// You may decide that GetAll returns too many secret property names for your use case.
// GetSubset allows you to filter out secret property names you don't care about.
// ignoreList is matched case insensitively
ignoreList := []string{
"id",
}
subset := secretnames.GetSubset(ignoreList)fmt.Println(len(subset) > 0)
fmt.Println(!slices.Contains(subset, "id"))// Output:
// true
// true
}
```## How are secret property names determined?
[generate-secret-property-names.sh](./generate-secret-property-names.sh) and [find-secret-property-names.js](./find-secret-property-names.js) are used to generate the list of secret property names.
This is done by running against a cloned [azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs) repository. These scripts look for property names in the specifications that are annotated with `x-ms-secret`.
## Regenerating the list
1. Clone this repository
1. Navigate to the repository directory
1. Clone [azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs)
1. Run the following command to generate the list of secret property names:```sh
./generate-secret-property-names.sh
```## License
MIT