diff options
author | Ryan Cobb <rcobb@gitlab.com> | 2019-10-08 01:07:18 +0300 |
---|---|---|
committer | Ryan Cobb <rcobb@gitlab.com> | 2019-10-17 00:20:47 +0300 |
commit | 576818b578be87a90c60c1e734fd5f6df48bb82f (patch) | |
tree | ccf29823c63f6f6837a91f21b8df78c20a91328f /app/services/error_tracking/list_projects_service.rb | |
parent | 7e2b1008547d8ced97a30e96ac6fbc2b7ad32a7f (diff) |
Mask Sentry auth token
This makes it so we mask Sentry's auth token. This mask only occurs in
the UI.
Diffstat (limited to 'app/services/error_tracking/list_projects_service.rb')
-rw-r--r-- | app/services/error_tracking/list_projects_service.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/services/error_tracking/list_projects_service.rb b/app/services/error_tracking/list_projects_service.rb index 8d08f0cda94..92d4ef85ecf 100644 --- a/app/services/error_tracking/list_projects_service.rb +++ b/app/services/error_tracking/list_projects_service.rb @@ -32,7 +32,7 @@ module ErrorTracking project_slug: 'proj' ) - setting.token = params[:token] + setting.token = token(setting) setting.enabled = true end end @@ -40,5 +40,12 @@ module ErrorTracking def can_read? can?(current_user, :read_sentry_issue, project) end + + def token(setting) + # Use param token if not masked, otherwise use database token + return params[:token] unless /\A\*+\z/.match?(params[:token]) + + setting.token + end end end |