ontola / ontola/atomic-server

Make a test framework for improved flexibility in authorization tests

Open
#233 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

server
Dominant language
TypeScript
Stars
1.6k
Forks
82
Avg merge
10h 34m
Merged PRs (30d)
205

Description

I've created various tests for authorization (both end-to-end, as in lib, as in server), but creating tests for more complicated scenarios is quite bothersome. I think I need to create some helper functions that improve developer experience and help me speed up how fast I can create these scenarios.

Some scenarios that should be tested:

  • A grants B some rights. B creates Invite that grants themself rights. A retracts B's rights. B uses earlier created Invite. Opening the Invite should result in an Unauthorized error.
  • A grants B some rights to resource R through some parent P. P is removed. R should not be accessible.

Ideas on better test tools / helper functions

  • Helper function that creates a Store + owner + guest + resource + parent.
  • Helper function for creating an Invite.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing authorization tests in lib and server to understand how Store, owners, guests, resources, parents, and Invites are currently created. Define reusable helpers for those scenarios, then cover the listed revocation and removed-parent cases and verify they produce Unauthorized errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authorization, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.