require 'auth' require 'p4_error' require 'p4_util' module HelixVersioningEngine class App < Sinatra::Base # The login command here is used in cases where the authentication source # is not the same as the p4d used as the backing instance. We'll generate # a host unlocked ticket using this method. post '/p4/:api/login' do user = params[:user] password = params[:password] # may be a p4 ticket if user.nil? or password.nil? fail P4Error.default_error('user or password is not set') end ticket = nil env['p4'] = P4Util.open_from_env(env) p4 = env['p4'] p4.user = user p4.password = password p4.connect ticket = Auth.ticket_from_login(p4) halt 403 if ticket.nil? {ticket: ticket }.to_json end end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 16114 | Doug Scheirer | Merge from main | ||
#1 | 15715 | Doug Scheirer | merge changes from main | ||
//guest/perforce_software/helix-web-services/main/source/helix_web_services/lib/helix_versioning_engine/app/login.rb | |||||
#1 | 15698 | tjuricek |
Added a /helix_versioning_engine/v[api]/login method This is used by the Helix Sync client to differentiate the auth source of HWS from that of P4D (to be used for projects). |