mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-06 07:54:22 +00:00
Encrypt git token in insertstruct
This commit is contained in:
@@ -19,15 +19,8 @@ func (db *database) CreateWorkspace(workspace *models.Workspace) error {
|
||||
workspace.SetDefaultSettings()
|
||||
}
|
||||
|
||||
// Encrypt token if present
|
||||
encryptedToken, err := db.encryptToken(workspace.GitToken)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to encrypt token: %w", err)
|
||||
}
|
||||
workspace.GitToken = encryptedToken
|
||||
|
||||
query, err := NewQuery(db.dbType).
|
||||
InsertStruct(workspace, "workspaces")
|
||||
InsertStruct(workspace, "workspaces", db.secretsService)
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create query: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user