Skip to content

feat!: replace global secret parameter with auto-generated secret#6

Merged
hrntknr merged 3 commits intomainfrom
feat/auto-generated-secrets
Aug 17, 2025
Merged

feat!: replace global secret parameter with auto-generated secret#6
hrntknr merged 3 commits intomainfrom
feat/auto-generated-secrets

Conversation

@hrntknr
Copy link
Copy Markdown
Member

@hrntknr hrntknr commented Aug 17, 2025

Summary

  • Remove GLOBAL_SECRET environment variable and command line flag
  • Add LoadOrGenerateSecret function to automatically generate and persist secrets
  • Update documentation to remove global secret references
  • Add developer guidelines for conventional commits

BREAKING CHANGE: GLOBAL_SECRET environment variable and --global-secret flag are no longer supported. Secrets are now automatically generated and persisted.

- Remove GLOBAL_SECRET environment variable and command line flag
- Add LoadOrGenerateSecret function to automatically generate and persist secrets
- Update documentation to remove global secret references
- Add developer guidelines for conventional commits

BREAKING CHANGE: GLOBAL_SECRET environment variable and --global-secret flag are no longer supported. Secrets are now automatically generated and persisted.
Copilot AI review requested due to automatic review settings August 17, 2025 16:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR replaces the global secret parameter system with an auto-generated secret mechanism. It removes the requirement for users to manually provide a global secret via environment variables or command line flags, instead automatically generating and persisting secrets to the filesystem.

  • Removes GLOBAL_SECRET environment variable and --global-secret command line flag
  • Implements automatic secret generation and persistence functionality
  • Updates documentation to reflect the breaking changes

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
pkg/utils/keys.go Adds LoadOrGenerateSecret function for automatic secret management
pkg/mcp-proxy/main.go Replaces manual secret handling with auto-generated secret loading
main.go Removes global secret command line flag and parameter
README.md Updates documentation to remove global secret references and adds developer guidelines

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread pkg/utils/keys.go Outdated
Comment thread pkg/utils/keys.go Outdated
func LoadOrGenerateSecret(secretPath string) ([]byte, error) {
_, err := os.Stat(secretPath)
if os.IsNotExist(err) {
secret := make([]byte, 32)
Copy link

Copilot AI Aug 17, 2025

Choose a reason for hiding this comment

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

The secret size of 32 bytes is a magic number. Consider defining it as a constant (e.g., const SecretSize = 32) to improve code maintainability and make the intention clearer.

Suggested change
secret := make([]byte, 32)
const SecretSize = 32
func LoadOrGenerateSecret(secretPath string) ([]byte, error) {
_, err := os.Stat(secretPath)
if os.IsNotExist(err) {
secret := make([]byte, SecretSize)

Copilot uses AI. Check for mistakes.
hrntknr and others added 2 commits August 18, 2025 01:59
Replace magic number 32 with SecretSize constant for better maintainability.
@hrntknr hrntknr merged commit 05ccbb2 into main Aug 17, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants