require 'p4_web_api_client' require 'p4_web_services_auth' module NotificationServices module Helpers # Creates a handle to the P4WebApi def open_p4_web_api_client(&block) # TODO we likely need a prefix path here conn_opts = { :url => settings.p4_web_api_url, :user => env['AUTH_CREDENTIALS'].first, :password => Helpers.resolve_password(env, settings) } unless settings.p4_web_api_prefix.nil? conn_opts[:prefix] = settings.p4_web_api_prefix end val = nil P4WebApiClient::Client.open(conn_opts) do |client| val = block.call(client) end val end def self.resolve_password(env, settings) password = env['AUTH_CREDENTIALS'].last if !P4WebServicesAuth::Auth.uuid?(password) password else P4WebServicesAuth::Auth.read_token(password, settings)['ticket'] end end end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 13972 | tjuricek |
Removing old microservice implementations. The system is now mostly a monolith. Eventually there will be a websocket service. |
||
#2 | 13675 | tjuricek |
Add notification_services initialization Removing the 'online setup' mode in lieu of doing things during the salt process. Mostly this removes the trigger setup from the main web application. |
||
#1 | 13467 | tjuricek | Add a basic notification_services endpoint that can setup a trigger entry and accept basic POST requests. |