diff options
author | Amit Rathi <amit.juschill@gmail.com> | 2019-06-05 19:50:29 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2019-06-05 19:50:29 +0000 |
commit | 13a8722464565b272bc00acd608761a3a83dcce0 (patch) | |
tree | 9b67c5e5ffe01e6288518537629090c91a823a6c /app | |
parent | 93d4353be91bc81a11e17cdf7e5dc3d347221542 (diff) | |
download | gitlab-ce-13a8722464565b272bc00acd608761a3a83dcce0.tar.gz |
Setup Git client for Jupyter
Diffstat (limited to 'app')
-rw-r--r-- | app/models/clusters/applications/jupyter.rb | 11 | ||||
-rw-r--r-- | app/services/clusters/applications/base_service.rb | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/app/models/clusters/applications/jupyter.rb b/app/models/clusters/applications/jupyter.rb index bd9c453e2a4..4aaa1f941e5 100644 --- a/app/models/clusters/applications/jupyter.rb +++ b/app/models/clusters/applications/jupyter.rb @@ -61,6 +61,10 @@ module Clusters "http://#{hostname}/hub/oauth_callback" end + def oauth_scopes + 'api read_repository write_repository' + end + private def specification @@ -94,7 +98,8 @@ module Clusters }, "singleuser" => { "extraEnv" => { - "GITLAB_CLUSTER_ID" => cluster.id.to_s + "GITLAB_CLUSTER_ID" => cluster.id.to_s, + "GITLAB_HOST" => gitlab_host } } } @@ -112,6 +117,10 @@ module Clusters Gitlab.config.gitlab.url end + def gitlab_host + Gitlab.config.gitlab.host + end + def content_values YAML.load_file(chart_values_file).deep_merge!(specification) end diff --git a/app/services/clusters/applications/base_service.rb b/app/services/clusters/applications/base_service.rb index 14a45437287..a9feb60be6e 100644 --- a/app/services/clusters/applications/base_service.rb +++ b/app/services/clusters/applications/base_service.rb @@ -81,7 +81,7 @@ module Clusters oauth_application_params = { name: params[:application], redirect_uri: application.callback_url, - scopes: 'api read_user openid', + scopes: application.oauth_scopes, owner: current_user } |