Skip to content

Commit 824c993

Browse files
Remove security warning from 00500-schedule-tables.md (#4463)
Now that scheduled reducers are private, this warning is no longer necessary. # Description of Changes - removed Security Considerations section from Schedule Tables documentation Signed-off-by: Tao Tien <29749622+taotien@users.noreply.github.com> Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
1 parent 9fbb322 commit 824c993

1 file changed

Lines changed: 0 additions & 71 deletions

File tree

docs/docs/00200-core-concepts/00300-tables/00500-schedule-tables.md

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -364,77 +364,6 @@ ctx.db[reminder].insert(Reminder{
364364
3. **When the time arrives**, the specified reducer/procedure is automatically called with the row as a parameter
365365
4. **The row is typically deleted** or updated by the reducer after processing
366366

367-
## Security Considerations
368-
369-
:::warning Scheduled Reducers Are Callable by Clients
370-
Scheduled reducers are normal reducers that can also be invoked by external clients. If a scheduled reducer should only execute via the scheduler, add authentication checks.
371-
:::
372-
373-
<Tabs groupId="server-language" queryString>
374-
<TabItem value="typescript" label="TypeScript">
375-
376-
```typescript
377-
export const send_reminder = spacetimedb.reducer({ arg: Reminder.rowType }, (ctx, { arg }) => {
378-
if (!ctx.senderAuth.isInternal) {
379-
throw new SenderError('This reducer can only be called by the scheduler');
380-
}
381-
// Process the scheduled reminder
382-
});
383-
```
384-
385-
</TabItem>
386-
<TabItem value="csharp" label="C#">
387-
388-
```csharp
389-
using SpacetimeDB;
390-
391-
public static partial class Module
392-
{
393-
[SpacetimeDB.Reducer]
394-
public static void SendReminder(ReducerContext ctx, Reminder reminder)
395-
{
396-
if (!ctx.SenderAuth.IsInternal)
397-
{
398-
throw new Exception("This reducer can only be called by the scheduler");
399-
}
400-
// Process the scheduled reminder
401-
}
402-
}
403-
```
404-
405-
</TabItem>
406-
<TabItem value="rust" label="Rust">
407-
408-
```rust
409-
#[spacetimedb::reducer]
410-
fn send_reminder(ctx: &ReducerContext, reminder: Reminder) -> Result<(), String> {
411-
if !ctx.sender_auth().is_internal() {
412-
return Err("This reducer can only be called by the scheduler".to_string());
413-
}
414-
// Process the scheduled reminder
415-
Ok(())
416-
}
417-
```
418-
419-
</TabItem>
420-
<TabItem value="cpp" label="C++">
421-
422-
```cpp
423-
SPACETIMEDB_REDUCER(send_reminder, ReducerContext ctx, Reminder arg)
424-
{
425-
// Check if this reducer is being called by the scheduler (internal)
426-
if (!ctx.sender_auth().is_internal()) {
427-
return Err("This reducer can only be called by the scheduler");
428-
}
429-
430-
// Process the scheduled reminder
431-
return Ok();
432-
}
433-
```
434-
435-
</TabItem>
436-
</Tabs>
437-
438367
## Use Cases
439368

440369
- **Reminders and notifications** - Schedule messages to be sent at specific times

0 commit comments

Comments
 (0)