-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add CLI change in that use the helper module * Added ability to block all apps Some Windows apps will block, some will not. For example, Visual Code is launched with code.cmd, which launches code.exe. Since code.cmd ends quickly, we don't get a chance to edit. So we have blocking that checks to see if the process name is actually running. MacOS UI apps have a different kind of blocking. The application needs to end. Also fixed the problem with the record type json not being included in the sdist. * Add github actions and handle parsing better * Add test for config command Add test for config and fixed a few problem. The color --enable/disabled did not work. * Allow user to recheck if record data file If the editor they are using is nonblocking, the CLI will complain about template markers being found before the user saves. This allows the user to finished editing and then typing 'r' to recheck the file. * Handle output and exceptions better * Add missing module to requirements.txt and setup.py * Tests are failing in GitHub action. Print the command results. * Fixed unit test and error message for config commands The unit test was failing because no keeper.ini file existed. Use the Mock config and the Export module too make a fake keeper.ini. Also fixed some of the error when a command fails.
- Loading branch information
Showing
42 changed files
with
4,051 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Publish to PyPI (KSM SDK Helper) | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish-pypi: | ||
name: Publish KSM SDK Helper to PyPI | ||
environment: prod | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 # To keep builds from running too long | ||
|
||
defaults: | ||
run: | ||
working-directory: ./sdk/python/helper | ||
|
||
steps: | ||
- name: Get the source code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Retrieve secrets from KSM | ||
id: ksmsecrets | ||
uses: Keeper-Security/ksm-action@master | ||
with: | ||
keeper-secret-config: ${{ secrets.KSM_PYPI_PUBLISHER_PYPI_SDK_CONFIG }} | ||
secrets: | | ||
-aBWi3-yU_qvatNh0Eaqew/field/password > PYPI_API_TOKEN | ||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade setuptools pip wheel twine | ||
python3 -m pip install -r requirements.txt | ||
- name: Build and Publish | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ steps.ksmsecrets.outputs.PYPI_API_TOKEN }} | ||
run: | | ||
python3 setup.py build | ||
python3 setup.py sdist | ||
python3 -m twine upload --verbose dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Test-Python-Helper | ||
|
||
on: | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test-cli: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8, 3.9] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
########## KSM Python SDK (from source) | ||
|
||
- name: Install SDK dependencies | ||
working-directory: ./sdk/python/core | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install -r requirements.txt | ||
python3 -m pip install -e . | ||
- name: Install SDK for integrations | ||
working-directory: ./sdk/python/core | ||
run: | | ||
python3 setup.py build install | ||
########## PYTHON HELPER | ||
|
||
- name: Install CLI dependencies | ||
working-directory: ./sdk/python/helper | ||
run: | | ||
python3 -m pip install -r requirements.txt | ||
python3 -m pip install pytest pytest-cov | ||
- name: Run CLI tests | ||
working-directory: ./sdk/python/helper | ||
run: | | ||
PYTHONPATH=$PWD pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.