GitGuardian / ggshield

Find and fix 400+ types of hardcoded secrets and 70+ types of infrastructure-as-code misconfigurations.
https://gitguardian.com
MIT License
1.68k stars 150 forks source link

Add default EU support for HMSL #990

Closed pierrelalanne closed 1 week ago

pierrelalanne commented 2 weeks ago

Summary

This MR teaches ggshield and HMSL how to support GitGuardian EU instance without special configurations.

Reminder: ggshield gets a JWT from a GitGuardian dashboard to later be authorized to call an HMSL instance.

Before this MR, the GitGuardian instance targeted to get a JWT was derived from the HMSL_URL defined in the config if any. This means that, unless you explicitly define it in your environment variable, you could never end up targeting the EU GitGuardian instance (there is no EU HMSL instance).

After this MR:

Additional notes

The logic is a bit complex here. Note that anyway, the user can override any of the concerned config values with environment variables.

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.57%. Comparing base (635ad8c) to head (3b2504f). Report is 17 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #990 +/- ## ========================================== - Coverage 91.58% 91.57% -0.02% ========================================== Files 180 180 Lines 7607 7607 ========================================== - Hits 6967 6966 -1 - Misses 640 641 +1 ``` | [Flag](https://app.codecov.io/gh/GitGuardian/ggshield/pull/990/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GitGuardian) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/GitGuardian/ggshield/pull/990/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GitGuardian) | `91.57% <100.00%> (-0.02%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GitGuardian#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.