Learn Everything

Paths/Backend Engineer/Authentication & Authorisation / OAuth & Scopes

Practice Taskintermediateubuntu:24.04Ask AI

Define the Scopes

Scopes are how an API says what a caller may do. Write the scope catalogue for the orders service, with the exact verbs your routes check.

Validator

⏱ 0:00

IDLE — checks run live as you type commands; submit when done

01Requirements

live checks
  • File ~/.auth/scopes.yaml exists○
  • The file lists the read and write scopes○
  • Each scope names the operations it allows○

02Walkthrough

1 of 2 revealed
  1. 01

    Write the scope catalogue

    Name scopes after what they allow, not after who holds them. A scope is checked by the route, so it has to match the route.

    echo 'scopes:\n - name: read:orders\n operations: [list_orders, get_order]\n - name: write:orders\n operations: [create_order, update_order]\n - name: admin:refunds\n operations: [refund_order]' > ~/.auth/scopes.yaml
  2. 1 locked · each failed submit reveals one

03Stuck?

0 of 3 revealed

Take a hint without losing the lab — each one points at the thing to look at, not at the answer.

04AI Tutor

guides, never solves

Tell me what you're stuck on — I'll nudge, not solve. Which requirement are you looking at?

04Notebook

saved locally in this browser

learner@lab — ubuntu:24.04

↑/↓ recalls commands · Ctrl+Enter submits · type help for the command list