Skip to content

Releases: mozership/probe-jmap

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 10 Oct 06:41
7c35474
uses: github.com/mozership/probe-jmap@f64bf107c6fd7435c4bb3f84e2f9116da761aadf # v0.3.0

Changelog

  • 2d6cc3f Add keep_session, which keeps the session in the job
  • a4dfd86 Add using_also, which adds to the inferred capabilities
  • d5155aa Fetch the session alone in a step without calls
  • 0ce3d97 Infer the core capability for PushSubscription and Blob/copy
  • 75dd882 Merge branch 'infer-push-subscription' into using-also
  • 1e76d31 Merge branch 'using-also' into session-alone
  • 99f2d16 Merge pull request #4 from mozership/infer-push-subscription
  • 86c04a3 Merge pull request #5 from mozership/using-also
  • 5a5d95a Merge pull request #6 from mozership/session-alone
  • ced150f Merge pull request #7 from mozership/keep-session
  • 7c35474 Merge pull request #8 from mozership/less-to-write
  • 5200003 Point action.yml at v0.2.0
  • 9f4c6ef Put header names in one case before ordering them for the session key
  • 98d9004 Test the account Blob/copy is made in when the session names one for core

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 09 Oct 12:16
7bb65b1
uses: github.com/mozership/probe-jmap@52000030f1bd839677830d1ab07a024183f581b7 # v0.2.0

Highlights

  • Its action.yml declares guard: [read-only, allow-host], so Probe v1.21.0 or later runs it under --read-only and --allow-host without --allow-action.
  • Its action.yml declares params, so probe check reports a key of with the action does not take.
  • A key of with the action does not take now fails the step.

Declaring the guard

The action already refused, before anything was sent, a method that may write under --read-only, and a host --allow-host does not allow, for the session, the API URL and each redirect. Probe could not tell, so it still refused the step unless --allow-action named the action. action.yml now declares both kinds, and Probe v1.21.0 or later runs the action under them.

Parameters

params: [url, calls, using, account_id, basic_auth, headers, timeout] in action.yml lets probe check report a misspelled key with its line. The action checks the same list itself, so a key that is not one of them fails the step before anything is sent; it used to be ignored.

Requirements

The action needs Probe v1.21.0 or later, which reads what action.yml declares. Its e2e runs on Probe v1.21.0 against Stalwart. See JMAP.

Changelog

  • e65bfa6 Declare the guard the action keeps to and the params it takes
  • 2d237fe Link to Probe where it is now, mozership/probe
  • 7ec02df Merge pull request #2 from mozership/link-mozership-probe
  • 7bb65b1 Merge pull request #3 from mozership/declare-guard-and-params
  • 295701f Point action.yml at v0.1.0

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 09 Oct 03:17
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