Skip to content

Commit

Permalink
Fix off-by-one in create shared keys (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubernetes-bad authored Jul 29, 2024
1 parent f8cffc2 commit 758a86a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion horde/apis/v2/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2743,7 +2743,7 @@ def put(self):
raise e.InvalidAPIKey("get sharedkey")
if user.is_anon():
raise e.AnonForbidden
if user.count_sharedkeys() > user.max_sharedkeys():
if user.count_sharedkeys() >= user.max_sharedkeys():
raise e.Forbidden(f"You cannot have more than {user.max_sharedkeys()} shared keys.")
expiry = None
if self.args.expiry and self.args.expiry != -1:
Expand Down

0 comments on commit 758a86a

Please sign in to comment.