Can't get JWT token for "*" actions scope

Summary

JWT auth token for scope: repository:name:* does not contain proper action claims though user is Master on repository and is Admin. This scope is required for deleting image from Registry.

Steps to reproduce

That works (returned token contains proper access in payload): GET https://git.example.com/jwt/auth/?service=container_registry&scope=repository:user/repo:pull

This does not (return token contains empty access in payload) GET https://git.example.com/jwt/auth/?service=container_registry&scope=repository:user/repo:*

Expected behavior

JWT auth token in payload should grant access to scope "repository:user/repo:*".

Actual behaviour

JWT auth token contains empty access in payload.

Relevant logs and/or screenshots

Looks like it is processed by JwtController#auth correctly:

Started GET "/jwt/auth/?service=container_registry&scope=repository:user/repo:*" for [...]
Processing by JwtController#auth as */*
  Parameters: {"service"=>"container_registry", "scope"=>"repository::user/repo:*"}
Completed 200 OK in 48ms (Views: 0.3ms | ActiveRecord: 2.9ms)

Output of checks

Results of GitLab application Check

Checking GitLab Shell ...

GitLab Shell version >= 3.4.0 ? ... OK (3.4.0)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ... 
9/4 ... ok
18/5 ... repository is empty
6/6 ... ok
6/7 ... ok
6/8 ... ok
11/9 ... ok
11/10 ... ok
23/11 ... repository is empty
26/12 ... ok
9/13 ... ok
11/14 ... ok
6/15 ... ok
29/17 ... repository is empty
29/18 ... ok
29/19 ... ok
6/20 ... ok
6/21 ... ok
26/22 ... ok
29/23 ... repository is empty
29/24 ... ok
6/26 ... ok
4/27 ... ok
29/28 ... ok
39/29 ... ok
39/30 ... ok
39/31 ... ok
4/32 ... ok
39/33 ... ok
4/34 ... ok
42/35 ... ok
4/36 ... ok
4/37 ... ok
4/38 ... ok
45/40 ... ok
46/41 ... ok
4/42 ... ok
26/43 ... ok
37/44 ... ok
4/45 ... ok
4/46 ... ok
4/47 ... ok
4/48 ... ok
4/49 ... ok
4/50 ... ok
5/52 ... repository is empty
5/53 ... ok
4/54 ... ok
56/55 ... ok
56/56 ... ok
4/59 ... ok
4/60 ... repository is empty
4/61 ... ok
4/62 ... ok
4/63 ... ok
4/64 ... ok
4/65 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: OK
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Reply by email ...

Reply by email is disabled in config/gitlab.yml

Checking Reply by email ... Finished

Checking LDAP ...

LDAP users with access to your GitLab server (only showing the first 100 results)
Server: ldapmain
	[REDACTED]

Checking LDAP ... Finished

Checking GitLab ...

Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... yes
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ... 
9/4 ... yes
18/5 ... yes
6/6 ... yes
6/7 ... yes
6/8 ... yes
11/9 ... yes
11/10 ... yes
23/11 ... yes
26/12 ... yes
9/13 ... yes
11/14 ... yes
6/15 ... yes
29/17 ... yes
29/18 ... yes
29/19 ... yes
6/20 ... yes
6/21 ... yes
26/22 ... yes
29/23 ... yes
29/24 ... yes
6/26 ... yes
4/27 ... yes
29/28 ... yes
39/29 ... yes
39/30 ... yes
39/31 ... yes
4/32 ... yes
39/33 ... yes
4/34 ... yes
42/35 ... yes
4/36 ... yes
4/37 ... yes
4/38 ... yes
45/40 ... yes
46/41 ... yes
4/42 ... yes
26/43 ... yes
37/44 ... yes
4/45 ... yes
4/46 ... yes
4/47 ... yes
4/48 ... yes
4/49 ... yes
4/50 ... yes
5/52 ... yes
5/53 ... yes
4/54 ... yes
56/55 ... yes
56/56 ... yes
4/59 ... yes
4/60 ... yes
4/61 ... yes
4/62 ... yes
4/63 ... yes
4/64 ... yes
4/65 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.1)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.7.4)
Active users: 47

Checking GitLab ... Finished

Results of GitLab environment info

System information
System:		Ubuntu 14.04
Current User:	git
Using RVM:	no
Ruby Version:	2.3.1p112
Gem Version:	2.6.6
Bundler Version:2.3.0
Rake Version:	10.5.0
Sidekiq Version:4.1.4

GitLab information
Version:	8.11.2
Revision:	e618ce2
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	postgresql
URL:		[REMOVED]
HTTP Clone URL:	[REMOVED]
SSH Clone URL:	[REMOVED]
Using LDAP:	yes
Using Omniauth:	no

GitLab Shell
Version:	3.4.0
Repository storage paths:
- default: 	/var/opt/gitlab/git-data/repositories
Hooks:		/opt/gitlab/embedded/service/gitlab-shell/hooks/
Git:		/opt/gitlab/embedded/bin/git

Possible fixes