Skip to content

Commit 5d470f0

Browse files
committed
forbid user and pk auth
1 parent c7c00e7 commit 5d470f0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

enterprise/coderd/provisionerdaemons.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func (p *provisionerDaemonAuth) authorize(r *http.Request, orgID uuid.UUID, tags
111111
return nil, xerrors.New("user unauthorized")
112112
}
113113

114-
// If using provisioner key / PSK auth, the daemon is, by definition, scoped to the organization.
114+
// If using PSK auth, the daemon is, by definition, scoped to the organization.
115115
tags = provisionersdk.MutateTags(uuid.Nil, tags)
116116
return tags, nil
117117
}
@@ -120,8 +120,7 @@ func (p *provisionerDaemonAuth) authorize(r *http.Request, orgID uuid.UUID, tags
120120
return tags, nil
121121
}
122122

123-
pk, ok := httpmw.ProvisionerKeyAuthOptional(r)
124-
if ok {
123+
if pkOK {
125124
if pk.OrganizationID != orgID {
126125
return nil, xerrors.New("provisioner key unauthorized")
127126
}

0 commit comments

Comments
 (0)