summaryrefslogtreecommitdiff
path: root/lib/chef/http
Commit message (Collapse)AuthorAgeFilesLines
* add require for CGIlcg/unescapeLamont Granquist2020-02-201-1/+2
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix ruby 2.7 URI.unescape deprecationLamont Granquist2020-02-201-2/+2
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Add chef-utils gem with various recipe DSL helpersLamont Granquist2019-11-081-1/+1
| | | | | | | | | | | | | This is the implementation of [RFC-087](https://github.com/chef-boneyard/chef-rfc/blob/master/rfc087-distro-sugar-helpers.md) although some of the specifics have been iterated on and changed. The documentation will be in the [README.md](https://github.com/chef/chef/tree/master/chef-utils/README.md) once this is merged. While this PR mostly moves chef-sugar utilities into core-chef via this chef-utils gem, the scope of the chef-utils gem should be considered larger than just that. As an example this PR moves the Mash class into this gem for reuse in ohai as well. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/SymbolProcLamont Granquist2019-07-051-2/+2
| | | | | | enforce pretzels. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/StringLiteralsInInterpolationLamont Granquist2019-07-051-1/+1
| | | | | | since we use double quotes, be consistent everywhere. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/NegatedIfLamont Granquist2019-07-051-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/EmptyMethodLamont Granquist2019-07-023-6/+3
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Layout/EmptyLineAfterGuardClauseLamont Granquist2019-07-026-0/+8
| | | | | | | i like this one, gives visual priority to returns or raises that are buried in the middle of things. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Layout/AlignArgumentslcg/new-chefstyleLamont Granquist2019-07-021-1/+1
| | | | | | | | | | | | | | this is using: Layout/AlignArguments: Enabled: true EnforcedStyle: with_fixed_indentation the default style can use really excessive whitespace. on starting lines which are already long, it fully indents across to where the arguments start and then begins the line there. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* distro constants for solo, zero and automateMarc Chamberland2019-05-231-1/+2
| | | | Signed-off-by: Marc Chamberland <mchamberland@pbsc.com>
* This hits the ones that are most frequently required.lcg/require-idempotencyLamont Granquist2019-05-206-9/+9
| | | | | | | | | Stops the kernel from scanning through all the activated gems every time in order to resolve names into pathnames. See rubygems/rubygems#2762 Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix a bunch of weirdly mangled require linesLamont Granquist2019-05-082-2/+2
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Convert require to require_relativeLamont Granquist2019-05-0815-28/+28
| | | | | | | This gives a speed boost since rubygems does not have to scan through every gem in the gemset in order to find the file. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* applying requested fixesMarc Chamberland2019-04-231-1/+1
| | | | Signed-off-by: Marc Chamberland <mchamberland@pbsc.com>
* Replacing workmarks with distro constantsMarc Chamberland2019-04-191-2/+3
| | | | Signed-off-by: Marc Chamberland <mchamberland@pbsc.com>
* changes for rubocop engine upgrades.lcg/rubocop-upgradesLamont Granquist2019-01-151-8/+8
| | | | | | | this is the result of changes to rules we already previously had enabled. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Fix duplicated query parametersLamont Granquist2018-07-131-1/+1
| | | | | | | rubocop rule led to us mutating the argument to the constructor here and continuously appending query params. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #7452 from chef/yard_cleanupTim Smith2018-07-121-2/+2
|\ | | | | Add proper yard deprecated tags on methods
| * Add proper deprecated tags on methodsTim Smith2018-05-301-2/+2
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* | fix Style/MutableConstantLamont Granquist2018-07-023-3/+3
| | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | fix Style/PreferredHashMethodsLamont Granquist2018-07-023-3/+3
| | | | | | | | | | | | | | absolutely hard requirement on the fixes that went into chef-config 2.2.11, so the floor of that gem is bumped up. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | fix Style/UnneededInterpolationLamont Granquist2018-07-022-2/+2
| | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | fix Layout/LeadingCommentSpaceLamont Granquist2018-07-021-1/+1
| | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | fix Style/HashSyntaxLamont Granquist2018-07-022-6/+6
| | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Feed the Rubocop.Noah Kantrowitz2018-05-311-1/+1
| | | | | | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* | Add support for signing requests using ssh-agent.Noah Kantrowitz2018-05-302-6/+11
|/ | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* mechanical conversion of most debug log statements to traceThom May2018-03-266-32/+32
| | | | Signed-off-by: Thom May <thom@chef.io>
* prepping for rubocop 0.52.1lcg/rubocop-0.52.1Lamont Granquist2018-01-173-6/+5
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #6131 from jamesbroadhead/add_HTTP_PATCHThom May2017-07-241-0/+3
|\ | | | | Add support for HTTP PATCH requests
| * Add support for HTTP PATCH requestsJames Broadhead2017-05-081-0/+3
| | | | | | | | Signed-off-by: James Broadhead <james.broadhead@mongodb.com>
* | Have a sensible default for old chef serverstm/no_api_versionThom May2017-07-051-0/+2
|/ | | | | | | If we don't see a version header, we should default to only supporting API version 0, and if we can't support that, then we should die as usual Signed-off-by: Thom May <thom@chef.io>
* RFC 67: Remove cookbook segmentsThom May2017-04-041-0/+1
| | | | | | | | | This implements RFC 67, which removes cookbook segments, and moves to a single list of all the files contained in a cookbook. This allows us to move forward with better audit modes and also proper shipping of ohai plugins. Signed-off-by: Thom May <thom@chef.io>
* Retry API requests if using an unsupported versiontm/retryable_apiThom May2017-03-292-6/+18
| | | | Signed-off-by: Thom May <thom@chef.io>
* Allow the best API version to be queriedThom May2017-03-281-1/+2
| | | | | | Also tidy up in the face of the real world. Signed-off-by: Thom May <thom@chef.io>
* protect against nil response bodylcg/debug-log-bad-json-payloadLamont Granquist2017-03-021-1/+3
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* truncate long response bodies in debug outputLamont Granquist2017-03-021-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* add debug long for non-JSON responseLamont Granquist2017-03-021-1/+2
| | | | | | we should probably raise (?) but this at least helps us debug. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Beginning of automatic API version detectionThom May2017-02-141-0/+50
| | | | | | | | | When we make a request to a chef server, we capture the minimum and maximum support API versions and allow them to be queried. We then provide some infrastructure for making decisions on which class should be used, in a middleware-ish mechanism. Signed-off-by: Thom May <thom@chef.io>
* fix specs: RedundantReturn, RedundantSelf, RedundantBeginLamont Granquist2017-02-131-2/+2
| | | | | | department of redundancy department Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/NumericPredicate comparison stylelcg/numericpredicateLamont Granquist2016-12-211-2/+2
| | | | | | | | | | | | | Apparently rubocop thinks the default behavior should be that we have to rewrite every use of `foo == 0` into `foo.zero?` which is a big pile of NOPE for me. After discovering that `.zero?` is actually slower, I'd prefer to go the other direction. Same for `positive?` and `negative?`. These are the only uses of `zero?` in the chef/chef codebase, while I'm pretty sure the inverse rule would touch nearly every file. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Style/NilComparisonLamont Granquist2016-12-061-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Style/BlockDelimiters, Style/MultilineBlockLayout and 0.42.0 engine upgradeLamont Granquist2016-08-171-2/+2
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* auotfixing Style/SpaceAfterSemicolon copLamont Granquist2016-08-161-1/+1
|
* specs and lazying net-http client buildingLamont Granquist2016-08-111-1/+4
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* make keepalives entirely optionalLamont Granquist2016-08-091-1/+7
| | | | turn on only for the cookbook synchronizer
* use Net::HTTP.startLamont Granquist2016-08-091-1/+1
|
* update to latest chefstyle - fix casecmptm/fix_casecmpThom May2016-04-201-2/+2
|
* Update config specSalim Alam2016-03-211-0/+1
|
* Override no_proxy with internal matcherSalim Alam2016-03-211-1/+6
|
* - Restore previous behavior where we use the user/pass from the URI, if present.nls/proxy-cleanupChris Doherty2016-03-171-3/+11
| | | | - s/ChefConfig::Config.proxy_uri/Chef::Config.proxy_uri/