Skip to content

Commit

Permalink
Include version in metadata/profile
Browse files Browse the repository at this point in the history
  • Loading branch information
jgilpin committed Nov 6, 2024
1 parent 6c79fb6 commit 20c7ea2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/profiles/profileConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type ProfileConfig struct {
Attributes map[string]interface{} `json:"attributes"` // Flexible map of additional attributes
CreatedAt time.Time `json:"createdAt"` // Timestamp for profile creation
UpdatedAt time.Time `json:"updatedAt"` // Timestamp for last profile update
Version string `json:"version"` // profile version
}

// NewProfileStore creates a new profile store with flexible attributes and timestamps
Expand All @@ -48,6 +49,7 @@ func NewProfileStore(newStore NewStoreInterface, profileName string, endpoint st
Attributes: make(map[string]interface{}), // Empty map for flexible attributes
CreatedAt: time.Now(), // Set creation time
UpdatedAt: time.Now(), // Set initial update time
Version: URNNamespaceTemplate, // Set profile version to URN-based namespace template
},
}
return p, nil
Expand Down
2 changes: 2 additions & 0 deletions pkg/profiles/storeFile.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type FileMetadata struct {
ProfileName string `json:"profile_name"`
CreatedAt string `json:"created_at"`
EncryptionAlg string `json:"encryption_alg"`
Version string `json:"version"`
}

// Generates a safe, hashed filename from namespace and key
Expand Down Expand Up @@ -213,6 +214,7 @@ func (f *FileStore) SaveMetadata(profileName string) error {
ProfileName: profileName,
CreatedAt: time.Now().Format(time.RFC3339),
EncryptionAlg: "AES-256-GCM",
Version: URNNamespaceTemplate,
}

data, err := json.MarshalIndent(metadata, "", " ")
Expand Down

0 comments on commit 20c7ea2

Please sign in to comment.