diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-09-20 15:19:33 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-09-20 15:19:33 +0000 |
commit | 9be1c08e5dc099803ea5716c3ee898a91a9575ac (patch) | |
tree | 248e8f20e33a3d7db29da0549c4985758e291ef2 | |
parent | 2c0704fabcf81a995ed67ddeac56f4bbcd44ac12 (diff) | |
parent | 9021200ad3312666bbcd6e0b4a876023d72283ab (diff) | |
download | gitlab-ce-9be1c08e5dc099803ea5716c3ee898a91a9575ac.tar.gz |
Merge branch 'jwt' into 'master'
Removed format validation
**What does this MR do?**
Removals format validation for drone token
**Are there points in the code the reviewer needs to double check?**
Nothing
**Why was this MR needed?**
because drone migrated to JWT tokens and JWT token doesn't valid with current format ( i don't know how many symbols JWT can use for this )
See merge request !1359
-rw-r--r-- | app/models/project_services/drone_ci_service.rb | 2 | ||||
-rw-r--r-- | spec/models/project_services/drone_ci_service_spec.rb | 3 |
2 files changed, 1 insertions, 4 deletions
diff --git a/app/models/project_services/drone_ci_service.rb b/app/models/project_services/drone_ci_service.rb index b13fa3e9ecb..c73c4b058a1 100644 --- a/app/models/project_services/drone_ci_service.rb +++ b/app/models/project_services/drone_ci_service.rb @@ -26,7 +26,7 @@ class DroneCiService < CiService format: { with: /\A#{URI.regexp(%w(http https))}\z/, message: "should be a valid url" }, if: :activated? validates :token, presence: true, - format: { with: /\A([A-Za-z0-9]+)\z/ }, if: :activated? + if: :activated? after_save :compose_service_hook, if: :activated? diff --git a/spec/models/project_services/drone_ci_service_spec.rb b/spec/models/project_services/drone_ci_service_spec.rb index bad9a9e6e1a..e9967f5fe0b 100644 --- a/spec/models/project_services/drone_ci_service_spec.rb +++ b/spec/models/project_services/drone_ci_service_spec.rb @@ -34,8 +34,6 @@ describe DroneCiService do it { is_expected.to validate_presence_of(:drone_url) } it { is_expected.to allow_value('ewf9843kdnfdfs89234n').for(:token) } it { is_expected.to allow_value('http://ci.example.com').for(:drone_url) } - it { is_expected.not_to allow_value('token with spaces').for(:token) } - it { is_expected.not_to allow_value('token/with%spaces').for(:token) } it { is_expected.not_to allow_value('this is not url').for(:drone_url) } it { is_expected.not_to allow_value('http//noturl').for(:drone_url) } it { is_expected.not_to allow_value('ftp://ci.example.com').for(:drone_url) } @@ -48,7 +46,6 @@ describe DroneCiService do it { is_expected.not_to validate_presence_of(:drone_url) } it { is_expected.to allow_value('ewf9843kdnfdfs89234n').for(:token) } it { is_expected.to allow_value('http://drone.example.com').for(:drone_url) } - it { is_expected.to allow_value('token with spaces').for(:token) } it { is_expected.to allow_value('ftp://drone.example.com').for(:drone_url) } end end |