(ctx context.Context, arg ListAIBridgeClientsParams, prepared rbac.PreparedAuthorized)
| 1052 | } |
| 1053 | |
| 1054 | func (q *sqlQuerier) ListAuthorizedAIBridgeClients(ctx context.Context, arg ListAIBridgeClientsParams, prepared rbac.PreparedAuthorized) ([]string, error) { |
| 1055 | authorizedFilter, err := prepared.CompileToSQL(ctx, regosql.ConvertConfig{ |
| 1056 | VariableConverter: regosql.AIBridgeInterceptionConverter(), |
| 1057 | }) |
| 1058 | if err != nil { |
| 1059 | return nil, xerrors.Errorf("compile authorized filter: %w", err) |
| 1060 | } |
| 1061 | filtered, err := insertAuthorizedFilter(listAIBridgeClients, fmt.Sprintf(" AND %s", authorizedFilter)) |
| 1062 | if err != nil { |
| 1063 | return nil, xerrors.Errorf("insert authorized filter: %w", err) |
| 1064 | } |
| 1065 | |
| 1066 | query := fmt.Sprintf("-- name: ListAIBridgeClients :many\n%s", filtered) |
| 1067 | rows, err := q.db.QueryContext(ctx, query, arg.Client, arg.Offset, arg.Limit) |
| 1068 | if err != nil { |
| 1069 | return nil, err |
| 1070 | } |
| 1071 | defer rows.Close() |
| 1072 | var items []string |
| 1073 | for rows.Next() { |
| 1074 | var client string |
| 1075 | if err := rows.Scan(&client); err != nil { |
| 1076 | return nil, err |
| 1077 | } |
| 1078 | items = append(items, client) |
| 1079 | } |
| 1080 | return items, nil |
| 1081 | } |
| 1082 | |
| 1083 | func (q *sqlQuerier) ListAuthorizedAIBridgeSessions(ctx context.Context, arg ListAIBridgeSessionsParams, prepared rbac.PreparedAuthorized) ([]ListAIBridgeSessionsRow, error) { |
| 1084 | authorizedFilter, err := prepared.CompileToSQL(ctx, regosql.ConvertConfig{ |
nothing calls this directly
no test coverage detected