Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ocs): list accounts and aliases of current user #10735

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

st3iny
Copy link
Member

@st3iny st3iny commented Feb 20, 2025

Resolves #10588

Exemplary API response

GET https://localhost/ocs/v2.php/apps/mail/account/list

{
  "ocs": {
    "meta": {
      "status": "ok",
      "statuscode": 200,
      "message": "OK"
    },
    "data": [
      {
        "id": 1720,
        "email": "user@imap.localhost",
        "aliases": [
          {
            "id": 51,
            "email": "null@imap.localhost",
            "name": null
          }
        ]
      },
      {
        "id": 1724,
        "email": "bob@stalwart.localhost",
        "aliases": []
      },
      {
        "id": 2101,
        "email": "debug@imap.localhost",
        "aliases": [
          {
            "id": 49,
            "email": "catchall@imap.localhost",
            "name": "catchall"
          }
        ]
      },
    ]
  }
}

@st3iny
Copy link
Member Author

st3iny commented Feb 20, 2025

cc @marcelklehr in case you have remarks regarding the schema or you have suggestions for improvements

Comment on lines +20 to +21
* @method void setName(string|null $name)
* @method string|null getName()
Copy link
Member Author

@st3iny st3iny Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not strictly related but I noticed that the DB schema allows null values but the entity does not. Otherwise, I can't write a unit test for null values of the name column.

Copy link
Contributor

@kesselb kesselb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
@st3iny st3iny force-pushed the feat/ocs/list-accounts branch from f88d30b to 8122306 Compare February 27, 2025 21:06
@st3iny st3iny enabled auto-merge February 27, 2025 21:06
@st3iny st3iny merged commit f7b5181 into main Feb 27, 2025
35 checks passed
@st3iny st3iny deleted the feat/ocs/list-accounts branch February 27, 2025 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OCS endpoint to get the account list
3 participants