Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
orangecat
ollama
Commits
14220d98
"magic_pdf/vscode:/vscode.git/clone" did not exist on "88b909e20e0e27da406e694bf0010ea229e54406"
Unverified
Commit
14220d98
authored
Aug 16, 2023
by
Patrick Devine
Committed by
GitHub
Aug 16, 2023
Browse files
set the scopes correctly (#368)
parent
8ca50f24
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
server/auth.go
server/auth.go
+6
-1
No files found.
server/auth.go
View file @
14220d98
...
@@ -48,7 +48,12 @@ func (r AuthRedirect) URL() (string, error) {
...
@@ -48,7 +48,12 @@ func (r AuthRedirect) URL() (string, error) {
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
return
fmt
.
Sprintf
(
"%s?service=%s&scope=%s&ts=%d&nonce=%s"
,
r
.
Realm
,
r
.
Service
,
r
.
Scope
,
time
.
Now
()
.
Unix
(),
nonce
),
nil
scopes
:=
[]
string
{}
for
_
,
s
:=
range
strings
.
Split
(
r
.
Scope
,
" "
)
{
scopes
=
append
(
scopes
,
fmt
.
Sprintf
(
"scope=%s"
,
s
))
}
scopeStr
:=
strings
.
Join
(
scopes
,
"&"
)
return
fmt
.
Sprintf
(
"%s?service=%s&%s&ts=%d&nonce=%s"
,
r
.
Realm
,
r
.
Service
,
scopeStr
,
time
.
Now
()
.
Unix
(),
nonce
),
nil
}
}
func
getAuthToken
(
ctx
context
.
Context
,
redirData
AuthRedirect
,
regOpts
*
RegistryOptions
)
(
string
,
error
)
{
func
getAuthToken
(
ctx
context
.
Context
,
redirData
AuthRedirect
,
regOpts
*
RegistryOptions
)
(
string
,
error
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment