summaryrefslogtreecommitdiffstats
path: root/services/packages/alpine/repository.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/packages/alpine/repository.go')
-rw-r--r--services/packages/alpine/repository.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/services/packages/alpine/repository.go b/services/packages/alpine/repository.go
index 5264bd6c4a..24e673289a 100644
--- a/services/packages/alpine/repository.go
+++ b/services/packages/alpine/repository.go
@@ -39,13 +39,13 @@ func GetOrCreateRepositoryVersion(ownerID int64) (*packages_model.PackageVersion
}
// GetOrCreateKeyPair gets or creates the RSA keys used to sign repository files
-func GetOrCreateKeyPair(ownerID int64) (string, string, error) {
- priv, err := user_model.GetSetting(ownerID, alpine_module.SettingKeyPrivate)
+func GetOrCreateKeyPair(ctx context.Context, ownerID int64) (string, string, error) {
+ priv, err := user_model.GetSetting(ctx, ownerID, alpine_module.SettingKeyPrivate)
if err != nil && !errors.Is(err, util.ErrNotExist) {
return "", "", err
}
- pub, err := user_model.GetSetting(ownerID, alpine_module.SettingKeyPublic)
+ pub, err := user_model.GetSetting(ctx, ownerID, alpine_module.SettingKeyPublic)
if err != nil && !errors.Is(err, util.ErrNotExist) {
return "", "", err
}
@@ -56,11 +56,11 @@ func GetOrCreateKeyPair(ownerID int64) (string, string, error) {
return "", "", err
}
- if err := user_model.SetUserSetting(ownerID, alpine_module.SettingKeyPrivate, priv); err != nil {
+ if err := user_model.SetUserSetting(ctx, ownerID, alpine_module.SettingKeyPrivate, priv); err != nil {
return "", "", err
}
- if err := user_model.SetUserSetting(ownerID, alpine_module.SettingKeyPublic, pub); err != nil {
+ if err := user_model.SetUserSetting(ctx, ownerID, alpine_module.SettingKeyPublic, pub); err != nil {
return "", "", err
}
}
@@ -244,7 +244,7 @@ func buildPackagesIndex(ctx context.Context, ownerID int64, repoVersion *package
return err
}
- priv, _, err := GetOrCreateKeyPair(ownerID)
+ priv, _, err := GetOrCreateKeyPair(ctx, ownerID)
if err != nil {
return err
}