module HelixVersioningEngine # Methods for user resources. # # Users are a little different from standard specs, since deleting users # can require removing session data, etc. class App < Sinatra::Base get '/helix_versioning_engine/:api/users' do |_| require_p4 p4 = env['p4'] users = p4.run_users users.to_json end post '/helix_versioning_engine/:api/users' do |_| require_p4 p4 = env['p4'] results = p4.save_user(params, '-f') results.to_json end get '/helix_versioning_engine/:api/users/:user' do |_, user| require_p4 p4 = env['p4'] results = p4.run_user('-o', user) if results.empty? or HelixVersioningEngine.invalid_user_email?(results, user) halt 404 else results[0].to_json end end patch '/helix_versioning_engine/:api/users/:user' do |_, user| require_p4 p4 = env['p4'] results = p4.run_user('-o', user) if results.empty? or HelixVersioningEngine.invalid_user_email?(results, user) halt 404 return end spec = results[0] spec = spec.merge(filter_params(params)) spec['User'] = user unless spec.key?('User') results = p4.save_user(spec, '-f') results.to_json end delete '/helix_versioning_engine/:api/users/:user' do |_, user| require_p4 p4 = env['p4'] p4.run_user('-f', '-d', user) '' end end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15741 | ptomiak | Branch HWS for my use. | ||
//guest/perforce_software/helix-web-services/main/source/helix_web_services/lib/helix_versioning_engine/app/users.rb | |||||
#1 | 15622 | tjuricek |
Move source code to 'source/' subdirectory of branch. build/ will remain where it is. |
||
//guest/perforce_software/helix-web-services/main/helix_web_services/lib/helix_versioning_engine/app/users.rb | |||||
#4 | 15240 | tjuricek |
Set api level via request path on all Helix Versioning Engine methods. This will allow migration of applications to different P4D versions. Our internal methods (like project API) should attempt to handle backward compatibility similarly. P4WEBAPI-118 |
||
#3 | 15189 | tjuricek | Update files implementation, testing, and documentation. | ||
#2 | 15185 | tjuricek | Update user spec management implementation, tests, and documentation. | ||
#1 | 15032 | tjuricek |
Starting config and doc revisions. System is now broken while revisions underway. Configuration of the p4d connection is now done via a single HWSSettings middleware object injected into the Rack env. The HWSP4Cleanup middleware now cleans up any p4 injected into the Rack env. The Auth::App class now mostly just contains one method to generate a p4 ticket. /auth/v1/login. Added yard documentation for the main project. Yard docs have been reconfigured to dump into build/ directories. This should probably be done with each release. Hm... The top level rake file contains a task, 'all:doc', to update our documentation. This should probably be run for each checkin. Hm... Specs are now using Rack::Test on top of a 'live' p4d. I'd suggest you still use the p4util mechanism, which now dumps to a /tmp folder, so we can safely add P4IGNORE rules back into your local .p4config file. Old 'perforce' application now called 'helix_versioning_engine'. Removing cache data. Helix Sync may be slow. It may also get axed. We'll see. |
||
//guest/perforce_software/helix-web-services/main/helix_web_services/lib/perforce/app/users.rb | |||||
#3 | 13839 | tjuricek |
Conversion of the p4_project_service microservice to new monolithic system. This may not have an HTTP front end in the monolithic system. Project services are really just about how the core object model is structured. It's likely that each application will add their own wrinkles and extensions to the system, so it's unlikely we'll need a generic "project model". Exactly how extensions are registered and used is still a bit TBD at the moment. Previously they were to be registered webhooks, that model may change. Does not include tests yet. |
||
#2 | 13808 | tjuricek | Finish converting most of the core p4d API into the new monolithic system. | ||
#1 | 13799 | tjuricek |
Start with branch specs hosting in a new monolithic 'helix web services' project. Converting from a microservice to a monolithic architecture due to resource constraints at getting a deployable system running. Additionally, since it's not expected that people will upgrade often, the major benefit of microservices - being able to add services individually without affecting others - is not really a major benefit. The Ruby SDK will be consolidated into a single 'helix web services client' project. It may end up being distributed via Rubygems. This only runs branch specs at the moment. I want to get a CD pipeline setup for the monolithic server before revising more methods. |
||
//guest/perforce_software/helix-web-services/main/p4_web_api/p4_web_api/lib/p4_web_api/app/users.rb | |||||
#1 | 13412 | tjuricek |
Initial version of the web-services mainline. This is a collection of several projects, that will likely often get released together, though many of them may not always be relevant. See the README for more information. |