Skip to content

Commit

Permalink
enforce lowercase of username when created (#332)
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <[email protected]>
  • Loading branch information
vsoch authored Dec 22, 2020
1 parent 0c88404 commit a361bbc
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ represented by the pull requests that fixed them. Critical items to know are:


## [master](https://github.com/singularityhub/sregistry/tree/master) (master)
- enforcing usernames to be all lowercase (1.1.29)
- Added ability to specify Minio direct download from interface (1.1.28)
- Adding cleanup for Minio images no longer referenced in sregistry (1.1.27)
- Django various updates, version bump 2.2.10 to 2.2.13 (1.1.26)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.28
1.1.29
1 change: 0 additions & 1 deletion shub/apps/api/actions/push.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def collection_auth_check(request):
payload = "push|%s|%s|%s|%s|" % (collection_name, timestamp, name, tag)

# Validate Payload
print(payload)
if not validate_request(auth, payload, "push", timestamp):
raise PermissionDenied(detail="Unauthorized")

Expand Down
16 changes: 8 additions & 8 deletions shub/apps/main/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
def collection_query(q):
return Collection.objects.filter(
Q(name__contains=q)
| Q(containers__name__contains=q)
| Q(containers__tags__name__contains=q)
| Q(containers__tag__contains=q)
| Q(containers__name__icontains=q)
| Q(containers__tags__name__icontains=q)
| Q(containers__tag__icontains=q)
).distinct()


Expand All @@ -35,7 +35,7 @@ def container_query(q, across_collections=1):

# Query across collections for image name and tag
return Container.objects.filter(
Q(name__contains=q["image"]) | Q(tag__contains=q["tag"])
Q(name__icontains=q["image"]) | Q(tag__icontains=q["tag"])
).distinct()

# Query across collections for image name
Expand All @@ -44,14 +44,14 @@ def container_query(q, across_collections=1):
# Query a particular collection for image name and tag
if q["tag"] is not None:
return Collection.objects.filter(
Q(name__contains=q["image"])
| Q(collection__name__contains=q["collection"])
| Q(containers_tags__contains=q["tag"])
Q(name__icontains=q["image"])
| Q(collection__name__icontains=q["collection"])
| Q(containers_tags__icontains=q["tag"])
).distinct()

# Query a particular collection for image name
return Collection.objects.filter(
Q(name__contains=q["image"]) | Q(collection__name__contains=q["collection"])
Q(name__icontains=q["image"]) | Q(collection__name__icontains=q["collection"])
).distinct()


Expand Down
2 changes: 1 addition & 1 deletion shub/apps/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _create_user(

email = self.normalize_email(email)
user = self.model(
username=username,
username=username.lower(),
email=email,
is_staff=is_staff,
is_active=True,
Expand Down

0 comments on commit a361bbc

Please sign in to comment.