• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

emqx / emqx / 5038 / 1
85%
master: 82%

Build:
Build:
LAST BUILD BRANCH: bump-emqx-enterprise-dashboard-version-20251107-075738
DEFAULT BRANCH: master
Ran 16 Mar 2019 02:48AM UTC
Files 95
Run time 4s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

16 Mar 2019 02:43AM UTC coverage: 68.402% (-1.6%) from 69.964%
5038.1

push

travis-ci

web-flow
Improve emqx_hooks and credentials (#2309)

* Improve emqx_hooks and credentials

1. Modify the return modes of emqx hooks.

Change the return value of hook functions to:
- ok: stop the hook chain and return ok
- {error, Reason}: stop the hook chain and return error
- continue: continue the hook chain

And the return value of emqx_hooks:run/2 is changed to:
- ok
- {error, Reason}

And the return value of emqx_hooks:run/3:
- {ok, Acc}
- {error, Reason, Acc}

2. Treat password as a member of credentials.

Password should be wrapped in the `credentials` data-structure, as the
username/password pair together consists of an authentication method.
There can be some methods using some other credential data (e.g.
a JWT token), and these credential data should also be wrapped in the
the `credentials` data-structure.

An event `client.authenticate` is triggered when an user logs in:
```erlang
emqx_hooks:run('client.authenticate', [], Credentials)
```

A `default callback` that deny/allow any user (according to the
`allow_anonymous` config) should be appended to the end of the
callback chain.

The `credentails` is passed through all of the callbacks, and
can be changed over in this process.

* Refactor emqx hooks return mode

* Remove password from PState

3364 of 4918 relevant lines covered (68.4%)

211.68 hits per line

Source Files on job 5038.1
  • Tree
  • List 0
  • Changed 45
  • Source Changed 12
  • Coverage Changed 44
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1277
  • Travis Job 5038.1
  • 02fe8560 on github
  • Prev Job for on develop (#5008.1)
  • Next Job for on develop (#5040.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc