1
0
mirror of https://github.com/badges/shields.git synced 2025-11-30 06:21:32 +03:00
Commit Graph

3 Commits

Author SHA1 Message Date
Paul Melnikow
ce0ddf93fc Inject secrets into the services (#3652)
This is a reworking of #3410 based on some feedback @calebcartwright left on that PR.

The goals of injecting the secrets are threefold:

1. Simplify testing
2. Be consistent with all of the other config (which is injected)
3. Encapsulate the sensitive auth-related code in one place so it can be studied and tested thoroughly

- Rather than add more code to BaseService to handle authorization logic, it delegates that to an AuthHelper class.
- When the server starts, it fetches the credentials from `config` and injects them into `BaseService.register()` which passes them to `invoke()`.
- In `invoke()` the service's auth configuration is checked (`static get auth()`, much like `static get route()`).
- If the auth config is present, an AuthHelper instance is created and attached to the new instance.
- Then within the service, the password, basic auth config, or bearer authentication can be accessed via e.g. `this.authHelper.basicAuth` and passed to `this._requestJson()` and friends.
- Everything is being done very explicitly, so it should be very clear where and how the configured secrets are being used.
- Testing different configurations of services can now be done by injecting the config into `invoke()` in `.spec` files instead of mocking global state in the service tests as was done before. See the new Jira spec files for a good example of this.

Ref #3393
2019-07-09 23:14:36 -04:00
Caleb Cartwright
a4bd3f5fd6 Add SymfonyInsight stars badge, run [SymfonyInsight sensiolabs amo chrome-web-store redmine spigetratings vaadin-directory visualstudiomarketplacerating wordpress] (#2971)
* feat: added stars badge for symfony insight

* refactor: changed symfony star determination logic

* feat: updating symfony to handle old scan scenarios

* feat: updated symfony insight to handle older projects

* tests: removed another test for symfony insight per request
2019-02-20 17:15:31 -06:00
Caleb Cartwright
ca487ae086 Refactor [SymfonyInsight] to new service model and rename (#2572)
Based on some discussion/feedback here, this PR now contains several changes:

* Renames the `Sensiolabs` badge/service content to `SymfonyInsight` to reflect the rebranding of that product/service
* Refactors the original service to the new service model (using `BaseXmlService`)
* Updates the color scheme of the original/initial badge type (SymfonyInsight Grade) to more closely mirror the colors used by the vendor/service provider
* Adds a new badge type (violation counts/summary) 
* Adds both mocked and live tests (there were none before) for both the grade & violation badges using the new path `symfony/i` as well as a couple tests for the old path `sensiolabs/i` to check for backwards compatibility

Refs #1358
2019-01-07 00:28:45 -05:00