Commit Graph

56 Commits

Author SHA1 Message Date
twangboy
c7f45c241a
Pass encoding to stringutils.to_unicode 2019-04-30 16:29:03 -06:00
Daniel Wozniak
6eb2bce9be
Merge pull request #52334 from waynew/51879-fix-binary-pillar-return-error
51879 fix binary pillar return error
2019-04-11 20:45:16 -07:00
Gareth J. Greenaway
f848aa474d
Adding support back in with, a gated configuration option, for the old YAML Loader. 2019-04-05 11:31:03 -07:00
Wayne Werner
2aa971d2e5
lint cleanup 2019-03-28 12:41:16 -05:00
Wayne Werner
2b8c782891
Test gpg render with replace newlines 2019-03-26 19:41:40 -05:00
Wayne Werner
604b671ef9
Return binary data from gpg renderer
If we receive binary data, we should respond with binary data.
2019-03-26 19:41:26 -05:00
Dmitry Kuzmenko
07ac1ca244
Don't try to decrypt values without PGP header line 2018-12-12 12:25:35 +03:00
rallytime
969296ecbe
Merge branch '2018.3' into 'develop'
No conflicts.
2018-05-15 12:38:01 -04:00
Erik Johnson
d612bd27e4
Move/merge more test modules
This moves mislocated tests to their proper locations to match the files
they test, merging tests into existing modules where necessary.
2018-05-10 14:53:52 -05:00
Dmitry Kuzmenko
0f482b7633
Fixed GPG pillar decryption.
1. Returned back the ability to decrypt raw encrypted data containing no
begin/end marks.
2. Remove trailing newlines if decrypted in a new 'multi' way
implemented in #45781
2018-03-25 19:04:20 +03:00
Michael A. Smith
13cc08d67c
AWSKMS Decrypt: Fix PY3 Bytestring Errors 2018-03-10 16:49:50 -05:00
Michael A. Smith
f9793a3d52
AWSKMS Decrypt: Refactor for AWS Profile Support 2018-03-10 16:49:32 -05:00
Michael A. Smith
909f09c666
Add a KMS Envelope-Encryption Renderer 2018-03-10 16:49:31 -05:00
Ignat Korchagin
231853aae2 Add multisecret string tests to gpg renderer unit test 2018-01-30 14:30:05 +00:00
Ignat Korchagin
18c42297f6 Allow gpg renderer to render multiple ciphertexts in a single string 2018-01-30 14:13:01 +00:00
Erik Johnson
c65d4714e5
[PY3] Add unicode_literals to renderers and returners 2017-12-15 00:17:26 -06:00
Petr Michalec
ad05cc5d98
Fix names of NACL dec. methods 2017-09-19 15:46:12 +02:00
Mike Place
874dd2245a Merge pull request #41868 from yagnik/nacl_renderer
Add support for nacl renderer for encrypted data
2017-08-22 13:36:38 -06:00
Erik Johnson
3184168365 Use explicit unicode strings + break up salt.utils
This PR is part of what will be an ongoing effort to use explicit
unicode strings in Salt. Because Python 3 does not suport Python 2's raw
unicode string syntax (i.e. `ur'\d+'`), we must use
`salt.utils.locales.sdecode()` to ensure that the raw string is unicode.
However, because of how `salt/utils/__init__.py` has evolved into the
hulking monstrosity it is today, this means importing a large module in
places where it is not needed, which could negatively impact
performance. For this reason, this PR also breaks out some of the
functions from `salt/utils/__init__.py` into new/existing modules under
`salt/utils/`. The long term goal will be that the modules within this
directory do not depend on importing `salt.utils`.

A summary of the changes in this PR is as follows:

* Moves the following functions from `salt.utils` to new locations
  (including a deprecation warning if invoked from `salt.utils`):
  `to_bytes`, `to_str`, `to_unicode`, `str_to_num`, `is_quoted`,
  `dequote`, `is_hex`, `is_bin_str`, `rand_string`,
  `contains_whitespace`, `clean_kwargs`, `invalid_kwargs`, `which`,
  `which_bin`, `path_join`, `shlex_split`, `rand_str`, `is_windows`,
  `is_proxy`, `is_linux`, `is_darwin`, `is_sunos`, `is_smartos`,
  `is_smartos_globalzone`, `is_smartos_zone`, `is_freebsd`, `is_netbsd`,
  `is_openbsd`, `is_aix`
* Moves the functions already deprecated by @rallytime to the bottom of
  `salt/utils/__init__.py` for better organization, so we can keep the
  deprecated ones separate from the ones yet to be deprecated as we
  continue to break up `salt.utils`
* Updates `salt/*.py` and all files under `salt/client/` to use explicit
  unicode string literals.
* Gets rid of implicit imports of `salt.utils` (e.g. `from salt.utils
  import foo` becomes `import salt.utils.foo as foo`).
* Renames the `test.rand_str` function to `test.random_hash` to more
  accurately reflect what it does
* Modifies `salt.utils.stringutils.random()` (née `salt.utils.rand_string()`)
  such that it returns a string matching the passed size. Previously
  this function would get `size` bytes from `os.urandom()`,
  base64-encode it, and return the result, which would in most cases not
  be equal to the passed size.
2017-08-08 13:33:43 -05:00
Yagnik
709ffce86c Update to use nacl instead of naclenc 2017-06-22 01:02:04 +05:30
Yagnik
e6b836f69d Add support for nacl renderer for encrypted data 2017-06-21 22:32:15 +05:30
Pedro Algarvio
abe608d739
Drop @patch usage 2017-04-28 13:36:42 +01:00
Pedro Algarvio
d397763553
Adjust to the new LoaderModuleMockMixin usage 2017-03-28 19:03:59 +01:00
Pedro Algarvio
e7768705f9
Allow passing different loader_module_globals per loader_module 2017-03-28 19:02:51 +01:00
Pedro Algarvio
9b1e55aa85
Import the full module namespace to avoid import shadowing.
https://github.com/saltstack/salt/pull/39996#issuecomment-287857698
2017-03-28 19:02:47 +01:00
Pedro Algarvio
40a64191a1
Absolute imports and A LOT of code cleanup. 2017-03-01 01:33:07 +00:00
Pedro Algarvio
3beb3fb801
Move whatever we need from salttesting to salt.
Let's drop the salttesting dependency cycle.
2017-02-28 22:52:49 +00:00
Pedro Algarvio
15af4c9728
Test filenames conformity. Adjust for pytest. 2017-02-23 23:19:42 +00:00
rallytime
30f14d15df Merge branch '2016.3' into '2016.11'
Conflicts:
  - salt/config/__init__.py
  - salt/engines/slack.py
2017-01-04 16:54:58 -05:00
Jonathan Ballet
2e7f743371 yaml: support unicode serialization/deserialization
Fix: #30454
2017-01-04 13:29:28 +01:00
rallytime
c2b52ccf9c Merge branch '2016.3' into 'develop'
Conflicts:
  - salt/states/ipset.py
2016-06-24 16:03:11 -06:00
rallytime
ae8ad9329c Merge branch '2015.8' into '2016.3'
Conflicts:
  - salt/renderers/gpg.py
  - tests/unit/renderers/gpg_test.py
2016-06-24 14:45:37 -06:00
rallytime
d7a5e9b10e Remove test that doesn't actually test anything 2016-06-24 09:10:13 -06:00
Dmitry Kuzmenko
17b03e9d8b Allow to blacklist/whitelist renderers. (#33358)
* Allow to blacklist/whitelist renderers.

* Fix tests.

* Unit test for renderer blacklisting.

* Minor tests fixes
2016-05-20 10:41:51 -07:00
Justin Findlay
992a8af726 renderers.gpg unit tests: mock gpg command 2016-03-10 10:57:21 -07:00
Justin Findlay
5ce61abf57 rewrite GPG unit tests 2015-11-16 09:36:29 -07:00
Justin Findlay
40889d7d7e rewrite GPG unit tests 2015-07-16 09:37:37 -06:00
Aneesh Agrawal
4b9311507c Add new module type for serializers from issue #22257.
Move existing serializers from salt.utils.serializers to
salt.serializers.
2015-05-28 20:03:11 -04:00
Colton Myers
cca8ddc886 Merge remote-tracking branch 'upstream/2015.2' into merge-forward-develop
Conflicts:
    .pylintrc
    .testing.pylintrc
    salt/auth/pam.py
    salt/modules/win_status.py
    salt/utils/network.py
    salt/utils/schedule.py
    tests/unit/renderers/gpg_test.py
    tests/unit/states/boto_secgroup.py
2015-04-29 12:01:52 -06:00
Pedro Algarvio
51dba5c24b Use Salt's OrderedDict which always exists 2015-04-26 10:51:28 +01:00
Pedro Algarvio
0651c06ec0 Fix import 2015-04-10 00:04:17 +01:00
Pedro Algarvio
60f215f191 Add from __future__ import absolute_import 2015-01-30 22:25:04 +00:00
Mike Place
e3bf4bb6ee GPG test fix
Now with 100% fewer race conditions
2015-01-26 14:12:35 -07:00
Pedro Algarvio
41870ef3e0 Fix ensure in syspath call 2014-10-12 02:16:23 +01:00
Pedro Algarvio
4fca1c96da Set the cachedir to a relative path 2014-10-12 02:16:23 +01:00
Mike Place
7b9c313773 Check for gpg binary 2014-07-08 10:16:05 -06:00
Mike Place
44a06ef7f0 Fix gpg test 2014-07-07 15:26:27 -06:00
Pedro Algarvio
0564fc363e A more generic directory name 2014-06-10 03:25:14 +01:00
Pedro Algarvio
9bd6d330ec Change to an existing directory before importing keyring 2014-06-10 01:52:53 +01:00
Pedro Algarvio
9d208eaf76 Use an explicit path for the keydir not getcwd 2014-06-10 01:52:53 +01:00