Skip to content

402 Payment Required #2

Closed
Closed
@michielbdejong

Description

@michielbdejong

Similar to anyone logged in
we introduce "anyone who paid"; we'll need to pick a predicate similar to acl:AuthenticatedAgent, for instance acl:PayingAgent.

One test: 401 if you haven't authenticated at all and authenticating may help

  • If the current agent is not authenticated
  • Even if the ACL doc for a resource contains an authorization with acl:agentClass acl:PayingAgent
  • If there is at least one other authorization that would accept the request for some authenticated user
  • But based on just the other authorizations the request would be rejected for unauthenticated users

Then the server should give a 401 response like it normally would

One test: 402 if you haven't authenticated and paying is the only way in

  • If the current agent is not authenticated
  • And the ACL doc for a resource contains an authorization with acl:agentClass acl:PayingAgent
  • And there are no other authorization that would accept the request for any authenticated user
  • And the request would be rejected for unauthenticated users

Then the server should give a 402 response, along with a WWW-Pay header, for instance:

WWW-Pay: ilp-stream-webid realm=<realm>

Another test: 402 if you haven't paid

  • If the current agent is authenticated but didn't pay
  • And the ACL doc for a resource contains an authorization with acl:agentClass acl:PayingAgent
  • And based on that authorization the request would be accepted for authenticated users who paid
  • And based on just the other authorizations the request would be rejected for the current user

Then the server should give a 402 response, along with a WWW-Pay header, for instance:

WWW-Pay: ilp-stream-webid realm=<realm>

Another test: OK if paid

  • If the current agent is authenticated as a WebID who has already paid
  • And the ACL doc for a resource contains an authorization with acl:agentClass acl:PayingAgent
  • And based on that authorization the request would be accepted for authenticated users who paid

Then the server should give a 200 response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions