diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-09-20 13:30:14 +0200 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-09-20 13:30:14 +0200 |
commit | 5a4461dfa1862f007b9a1de8d621d5978006009e (patch) | |
tree | 9fda0f918c8c88bf70f92acace52b8edd766f5bb /lib/api/unleash.rb | |
parent | 34447c588486e5fc9deb4498b34c9d71117a496e (diff) | |
download | gitlab-ce-feature-flags-backend.tar.gz |
Refactor API interfacefeature-flags-backend
Diffstat (limited to 'lib/api/unleash.rb')
-rw-r--r-- | lib/api/unleash.rb | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/lib/api/unleash.rb b/lib/api/unleash.rb deleted file mode 100644 index e4f9d00d3ff..00000000000 --- a/lib/api/unleash.rb +++ /dev/null @@ -1,41 +0,0 @@ -module API - class Unleash < Grape::API - include PaginationParams - - before do - unauthorized! unless access_token - end - - get ':unleash/features' do - present @project, with: Entities::UnleashFeatures - end - - post 'unleash/client/register' do - status :ok - end - - post 'unleash/client/metrics' do - status :ok - end - - private - - helpers do - def project - @project ||= find_project(unleash_appname) - end - - def access_token - @access_token ||= ProjectFeatureFlagsAccessToken.find_by(token: unleash_instanceid, project: project) - end - - def unleash_appname - params[:appname] || env[:HTTP_UNLEASH_APPNAME] - end - - def unleash_instanceid - params[:instanceid] || env[:HTTP_UNLEASH_INSTANCEID] - end - end - end -end |