-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'staging' into rdv-solidarites-oauth
- Loading branch information
Showing
388 changed files
with
5,315 additions
and
1,605 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn lint | ||
if [[ $(git status --porcelain | grep app/javascript/) ]]; then # only run the linter if the javascript files have changed | ||
yarn lint | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class AddressGeocodingBlueprint < ApplicationBlueprint | ||
fields :post_code, :city | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
class AcceptCgusController < ApplicationController | ||
before_action :ensure_cgus_are_accepted | ||
|
||
def create | ||
if current_agent.update(cgu_accepted_at: Time.zone.now) | ||
head :no_content | ||
else | ||
turbo_stream_display_custom_error_modal( | ||
title: "L'acceptation n'a pas fonctionné", | ||
errors: current_agent.errors.full_messages, | ||
with_support_contact: true | ||
) | ||
end | ||
end | ||
|
||
private | ||
|
||
def ensure_cgus_are_accepted | ||
return if params[:cgu_accepted] == "1" | ||
|
||
turbo_stream_display_error_modal(["Vous devez accepter les CGUs"]) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
require "ipaddr" | ||
|
||
module Brevo::IpWhitelistConcern | ||
extend ActiveSupport::Concern | ||
|
||
# IP list comes from | ||
# https://help.brevo.com/hc/en-us/articles/15127404548498-Brevo-IP-ranges-List-of-publicly-exposed-services#h_01HENC062K8KJKJE7BJNYMPM77 | ||
IP_WHITELIST_RANGE = "1.179.112.0/20".freeze | ||
|
||
included do | ||
before_action :ensure_ip_comes_from_brevo_ips | ||
end | ||
|
||
private | ||
|
||
def ensure_ip_comes_from_brevo_ips | ||
# In case Brevo decides to use some other IP range without notice | ||
# we need a quick way to skip this check | ||
return if ENV["DISABLE_BREVO_IP_WHITELIST"].present? | ||
|
||
return if IPAddr.new(IP_WHITELIST_RANGE).include?(request.remote_ip) | ||
|
||
Sentry.capture_message("Brevo Webhook received with following non whitelisted IP", { | ||
extra: { | ||
ip: request.remote_ip | ||
} | ||
}) | ||
head :forbidden | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.