Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.0b6 #86

Merged
merged 10 commits into from
Oct 3, 2024
Merged
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* text git-encoding=utf-8 zos-working-tree-encoding=iso8859-1 working-tree-encoding=utf-8 eol=lf
*.png binary
README.md git-encoding=utf-8 zos-working-tree-encoding=utf-8 working-tree-encoding=utf-8 eol=lf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: pyRACF Linting & Unit Test
name: coverage
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -14,16 +14,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: curl -sSL https://install.python-poetry.org | python3 -
run: pipx install poetry
- name: Show Poetry Environment Info
run: poetry env info
- name: Install Development Dependencies
run: poetry install --no-root
- name: Flake8
run: poetry run flake8 .
- name: Pylint
run: poetry run pylint --recursive=y .
- name: Unit Test
- name: unittest
run: poetry run coverage run tests/test_runner.py
- name: Code Coverage
- name: coverage
run: poetry run coverage report -m
23 changes: 23 additions & 0 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: flake8
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: pipx install poetry
- name: Show Poetry Environment Info
run: poetry env info
- name: Install Development Dependencies
run: poetry install --no-root
- name: flake8
run: poetry run flake8 .
23 changes: 23 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: pylint
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: pipx install poetry
- name: Show Poetry Environment Info
run: poetry env info
- name: Install Development Dependencies
run: poetry install --no-root
- name: pylint
run: poetry run pylint --recursive=y .
23 changes: 23 additions & 0 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: unittest
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: pipx install poetry
- name: Show Poetry Environment Info
run: poetry env info
- name: Install Development Dependencies
run: poetry install --no-root
- name: unittest
run: poetry run coverage run tests/test_runner.py
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
![pyRACF Logo](logo.png)
![pyRACF Logo](https://raw.githubusercontent.com/ambitus/pyracf/refs/heads/main/logo.png)

![GitHub Actions Build Status](https://github.com/ambitus/pyracf/actions/workflows/.github-actions.yml/badge.svg?branch=dev)
[![tests](https://github.com/ambitus/pyracf/actions/workflows/unittest.yml/badge.svg)](https://github.com/ambitus/pyracf/actions/workflows/unittest.yml)
[![coverage](https://github.com/ambitus/pyracf/actions/workflows/coverage.yml/badge.svg)](https://github.com/ambitus/pyracf/actions/workflows/coverage.yml)
[![pylint](https://github.com/ambitus/pyracf/actions/workflows/pylint.yml/badge.svg)](https://github.com/ambitus/pyracf/actions/workflows/pylint.yml)
[![flake8](https://github.com/ambitus/pyracf/actions/workflows/flake8.yml/badge.svg)](https://github.com/ambitus/pyracf/actions/workflows/flake8.yml)
[![Beta Version](https://img.shields.io/pypi/v/pyracf?label=beta)](https://pypi.org/project/pyracf/#history)
[![Python Versions](https://img.shields.io/pypi/pyversions/pyracf)](https://pypi.org/project/pyracf/)
[![Download Stats](https://img.shields.io/pypi/dm/pyracf)](https://pypistats.org/packages/pyracf)

> ⚠️ _If this is not what you are looking for, it is likely because you are looking for a different package that used to be distributed under the `pyracf` name. You may instead be looking for the [`mfpandas`](https://pypi.org/project/mfpandas/) package, which was distributed under the `pyracf` name prior to October 2024._

Python interface into the RACF management application programming interface.

Expand Down Expand Up @@ -32,9 +40,11 @@ As automation becomes more and more prevalent, the need to manage the security e

### Installation

:warning: _pyRACF will eventually be made available on [pypi.org](https://pypi.org/), but currently python wheel distributions for pyRACF are only available for manual download and installation via GitHub._
```shell
pip install pyracf
```

* [Download & Install From GitHub](https://github.com/ambitus/pyracf/releases)
> 💡 _You may also optionally [Download & Install pyRACF From GitHub](https://github.com/ambitus/pyracf/releases)._

### Usage

Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[tool.poetry]
name="pyracf"
version="1.0b5"
version="1.0b6"
description="Python interface to RACF using IRRSMO00 RACF Callable Service."
license = "Apache-2.0"
authors = [
Expand All @@ -28,6 +28,7 @@
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Security",
Expand Down
4 changes: 2 additions & 2 deletions pyracf/common/security_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def _to_steps(self, results: Union[List[dict], dict, bytes]) -> Union[dict, byte
pre_processed_results.append(result)
steps_dictionary = {}
for step, result_dictionary in enumerate(pre_processed_results):
steps_dictionary[f"step{step+1}"] = result_dictionary
steps_dictionary[f"step{step + 1}"] = result_dictionary
return steps_dictionary

# ============================================================================
Expand Down Expand Up @@ -579,7 +579,7 @@ def __format_user_profile_data(
)
i += 3
elif "=" not in messages[i] and messages[i].strip()[:3] != "NO-":
messages[i] = f"{messages[i]}={messages[i+1]}"
messages[i] = f"{messages[i]}={messages[i + 1]}"
self.__add_key_value_pairs_to_segment(
current_segment, profile[current_segment], messages[i]
)
Expand Down
4 changes: 2 additions & 2 deletions pyracf/common/utilities/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ def log_debug(self, header_message: str, message: str) -> None:
admin_class = "".join(class_tokens)
function_called_by_user = f"{admin_class}.{user_call[1]}()"
header = (
f"{self.__purple_background(' '*79)}\n"
f"{self.__purple_background(' ' * 79)}\n"
+ f"{self.__purple_background('[pyRACF:Debug]'.center(79))}\n"
+ f"{self.__purple_background(header_message.center(79))}\n"
+ f"{self.__purple_background(function_called_by_user.center(79))}\n"
+ f"{self.__purple_background(' '*79)}\n"
+ f"{self.__purple_background(' ' * 79)}\n"
)
print(f"{header}\n{message}")

Expand Down
Loading