diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2019-05-23 14:53:10 +0000 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2019-05-23 14:53:10 +0000 |
commit | 671fadf1ab604daa0caf61944a9a152836dffecb (patch) | |
tree | 66366bec274cff0e8a9fa37dd049a91bc06a0be8 /lib/api | |
parent | 17971f86a4041e42e650de3b2de78128a2096d5c (diff) | |
parent | 00c851384e8bc957f601d27c25c36c2ca80b60c1 (diff) | |
download | gitlab-ce-671fadf1ab604daa0caf61944a9a152836dffecb.tar.gz |
Merge branch 'api_masked_variables' into 'master'
API: Allow to get and set "masked" attribute for variables
Closes #61754
See merge request gitlab-org/gitlab-ce!28381
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/entities.rb | 1 | ||||
-rw-r--r-- | lib/api/variables.rb | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 1a3318fe849..96a1ccefbe5 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -1303,6 +1303,7 @@ module API class Variable < Grape::Entity expose :variable_type, :key, :value expose :protected?, as: :protected, if: -> (entity, _) { entity.respond_to?(:protected?) } + expose :masked?, as: :masked, if: -> (entity, _) { entity.respond_to?(:masked?) } end class Pipeline < PipelineBasic diff --git a/lib/api/variables.rb b/lib/api/variables.rb index a1bb21b3a06..b07dd1bab79 100644 --- a/lib/api/variables.rb +++ b/lib/api/variables.rb @@ -55,6 +55,7 @@ module API requires :key, type: String, desc: 'The key of the variable' requires :value, type: String, desc: 'The value of the variable' optional :protected, type: String, desc: 'Whether the variable is protected' + optional :masked, type: String, desc: 'Whether the variable is masked' optional :variable_type, type: String, values: Ci::Variable.variable_types.keys, desc: 'The type of variable, must be one of env_var or file. Defaults to env_var' if Gitlab.ee? @@ -81,6 +82,7 @@ module API optional :key, type: String, desc: 'The key of the variable' optional :value, type: String, desc: 'The value of the variable' optional :protected, type: String, desc: 'Whether the variable is protected' + optional :masked, type: String, desc: 'Whether the variable is masked' optional :variable_type, type: String, values: Ci::Variable.variable_types.keys, desc: 'The type of variable, must be one of env_var or file' if Gitlab.ee? |