MCPcopy Index your code
hub / github.com/coder/coder / insertAuthorizedFilter

Function insertAuthorizedFilter

coderd/database/modelqueries.go:1249–1255  ·  view source on GitHub ↗
(query string, replaceWith string)

Source from the content-addressed store, hash-verified

1247}
1248
1249func insertAuthorizedFilter(query string, replaceWith string) (string, error) {
1250 if !strings.Contains(query, authorizedQueryPlaceholder) {
1251 return "", xerrors.Errorf("query does not contain authorized replace string, this is not an authorized query")
1252 }
1253 filtered := strings.ReplaceAll(query, authorizedQueryPlaceholder, replaceWith)
1254 return filtered, nil
1255}
1256
1257// UpdateUserLinkRawJSON is a custom query for unit testing. Do not ever expose this
1258func (q *sqlQuerier) UpdateUserLinkRawJSON(ctx context.Context, userID uuid.UUID, data json.RawMessage) error {

Calls 2

ContainsMethod · 0.45
ErrorfMethod · 0.45

Tested by 1

TestIsAuthorizedQueryFunction · 0.68