Skip to content

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 09 Oct 03:17
· 27 commits to main since this release
9335f1b
uses: github.com/mozership/probe-jmap@295701f5263fffd64161a34dd377722ccad3923a # v0.1.0

Highlights

  • The first release: a Probe action that calls JMAP methods (RFC 8620, RFC 8621).
  • It fetches the session, fills in the account of each call and the capabilities it uses, and returns the responses by call id.
  • A method error comes with HTTP 200 in JMAP, so the action gathers every failure in res.errors, and status is 1 when there is any.
  • It needs Probe v1.20.0 or later.

Calling methods

- name: Read the latest message
  uses: github.com/mozership/probe-jmap@295701f5263fffd64161a34dd377722ccad3923a # v0.1.0
  with:
    url: https://jmap.example.com
    basic_auth:
      username: "{{vars.user}}"
      password: "{{vars.pass}}"
    calls:
      - method: Email/query
        id: latest
        args:
          sort: [{property: receivedAt, isAscending: false}]
          limit: 1
      - method: Email/get
        id: email
        args:
          "#ids": {resultOf: latest, path: /ids}
          properties: [subject, from]
  test: status == 0 && len(res.results.email.list) == 1
  • A url with no path is the server, whose session is at /.well-known/jmap; the API URL is read from the session, after any redirect.
  • A call without accountId is made in the primary account of its capability, and using is inferred from the method names. A back-reference may leave out name.
  • res.results holds the arguments of each response by call id. res.errors gathers method errors, the records a /set call could not create, update or destroy, a request the server refused as a whole, and a session it did not give, each with its kind.
  • Any response the server sends is a result; only a request that gets no response fails the step as an error.

Guard

Under --read-only, a step whose calls include a method that may write is refused before anything is sent, and a host --allow-host does not allow is refused, for the session, the API URL and each redirect. Probe v1.20.0 cannot tell that an external action keeps to the guard, so a step that uses it under a guard still needs --allow-action. v0.2.0 declares the guard in action.yml, for Probe v1.21.0 to run it without.

Testing

The unit tests answer from stub servers, and the e2e workflow runs the action through Probe against Stalwart: alice sends a message that bob finds in his inbox, and each kind of failure comes back in res.errors.

Changelog

  • 8a6c101 Call JMAP methods from a Probe workflow
  • 9335f1b Merge pull request #1 from mozership/e2e-stalwart
  • ad82b61 Read the request of a step as req, and name the identity outputs apart
  • 832e3ed Run the action against Stalwart in an end-to-end workflow
  • 717cf14 Take the request error Stalwart sends for an unknown capability