Skip to content

Commit 3e1a94b

Browse files
committed
address PR comment
1 parent 89030f2 commit 3e1a94b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

enterprise/coderd/provisionerdaemons.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,14 @@ func (p *provisionerDaemonAuth) authorize(r *http.Request, tags map[string]strin
117117
if p.psk != "" {
118118
psk := r.Header.Get(codersdk.ProvisionerDaemonPSK)
119119
if subtle.ConstantTimeCompare([]byte(p.psk), []byte(psk)) == 1 {
120-
return provisionerdserver.MutateTags(uuid.Nil, tags), true
120+
if len(tags) == 0 {
121+
// Directly scope to organization if no tags are provided.
122+
// MutateTags is only meant for scoping based on users.
123+
tags = map[string]string{
124+
provisionerdserver.TagScope: provisionerdserver.ScopeOrganization,
125+
}
126+
}
127+
return tags, true
121128
}
122129
}
123130
return nil, false

0 commit comments

Comments
 (0)