BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
267e27b0
Commit
267e27b0
authored
Aug 22, 2016
by
Douglas Barbosa Alexandre
Committed by
Stan Hu
Nov 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove code to clone Bitbucket repositories using SSH
parent
ceac7878
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 addition
and
50 deletions
+1
-50
application_controller.rb
app/controllers/application_controller.rb
+1
-1
public_key.rb
config/initializers/public_key.rb
+0
-2
key_adder.rb
lib/gitlab/bitbucket_import/key_adder.rb
+0
-24
key_deleter.rb
lib/gitlab/bitbucket_import/key_deleter.rb
+0
-23
No files found.
app/controllers/application_controller.rb
View file @
267e27b0
...
@@ -254,7 +254,7 @@ class ApplicationController < ActionController::Base
...
@@ -254,7 +254,7 @@ class ApplicationController < ActionController::Base
end
end
def
bitbucket_import_configured?
def
bitbucket_import_configured?
Gitlab
::
OAuth
::
Provider
.
enabled?
(
:bitbucket
)
&&
Gitlab
::
BitbucketImport
.
public_key
.
present?
Gitlab
::
OAuth
::
Provider
.
enabled?
(
:bitbucket
)
end
end
def
google_code_import_enabled?
def
google_code_import_enabled?
...
...
config/initializers/public_key.rb
deleted
100644 → 0
View file @
ceac7878
path
=
File
.
expand_path
(
"~/.ssh/bitbucket_rsa.pub"
)
Gitlab
::
BitbucketImport
.
public_key
=
File
.
read
(
path
)
if
File
.
exist?
(
path
)
lib/gitlab/bitbucket_import/key_adder.rb
deleted
100644 → 0
View file @
ceac7878
module
Gitlab
module
BitbucketImport
class
KeyAdder
attr_reader
:repo
,
:current_user
,
:client
def
initialize
(
repo
,
current_user
,
access_params
)
@repo
,
@current_user
=
repo
,
current_user
@client
=
Client
.
new
(
access_params
[
:bitbucket_access_token
],
access_params
[
:bitbucket_access_token_secret
])
end
def
execute
return
false
unless
BitbucketImport
.
public_key
.
present?
project_identifier
=
"
#{
repo
[
"owner"
]
}
/
#{
repo
[
"slug"
]
}
"
client
.
add_deploy_key
(
project_identifier
,
BitbucketImport
.
public_key
)
true
rescue
false
end
end
end
end
lib/gitlab/bitbucket_import/key_deleter.rb
deleted
100644 → 0
View file @
ceac7878
module
Gitlab
module
BitbucketImport
class
KeyDeleter
attr_reader
:project
,
:current_user
,
:client
def
initialize
(
project
)
@project
=
project
@current_user
=
project
.
creator
@client
=
Client
.
from_project
(
@project
)
end
def
execute
return
false
unless
BitbucketImport
.
public_key
.
present?
client
.
delete_deploy_key
(
project
.
import_source
,
BitbucketImport
.
public_key
)
true
rescue
false
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment