Skip to content

Commit

Permalink
1.9.14 (#37)
Browse files Browse the repository at this point in the history
* 1.9.14

* 1.9.14

* 1.9.14

* 1.9.14

* 1.9.14

* 1.9.14

* 1.9.14

* 1.9.14

* 1.9.14

* 1.9.14

* 1.9.14

* 1.9.14

* 1.9.14
  • Loading branch information
gattjoe authored Oct 27, 2024
1 parent 97d173f commit c9db90c
Show file tree
Hide file tree
Showing 14 changed files with 288 additions and 228 deletions.
33 changes: 30 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,39 @@
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "../Dockerfile",
// Set *default* container specific settings.json values on container create.
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "false",
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": "true"
},
"ghcr.io/devcontainers/features/python:1": "none",
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": "false"
}
},
"customizations": {
"vscode": {
"extensions": [
"ms-python.vscode-pylance",
"visualstudioexptteam.vscodeintellicode"
"ms-python.python",
"ms-python.isort",
"ms-python.black-formatter",
"ms-python.pylint"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python3",
"pylint.enabled": true,
"pylint.importStrategy": "fromEnvironment", // Manage pylint separate from extension
"pylint.lintOnChange": true,
"pylint.path": [
"/usr/local/bin/pylint"
],
"python.formatting.blackPath": "/usr/local/bin/black"
},
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.profiles.linux": {
"bash": {
Expand All @@ -21,6 +48,6 @@
}
}
},
"postCreateCommand": "pip install --no-cache-dir --user --quiet -r /home/ocspdev/OcspChecker/requirements.txt",
"remoteUser": "ocspdev"
"postCreateCommand": "pip install --user -r /home/vscode/OcspChecker/dev-requirements.txt && pip install --user -r /home/vscode/OcspChecker/requirements.txt",
"remoteUser": "vscode"
}
87 changes: 44 additions & 43 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: OCSP-Checker
name: OCSPChecker

on: [push]

jobs:
test:
name: ${{ matrix.os }}-python${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os:
[
ubuntu-20.04,
Expand All @@ -18,61 +19,61 @@ jobs:
macos-11,
]
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag=v3.3.0
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # tag=v4.2.1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # tag=v4.7.1
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # tag=v5.3.0
with:
python-version: ${{ matrix.python-version }}
- name: Install tools
run: |
python -m pip install --upgrade pip setuptools wheel
- name: Install pytest
run: |
python -m pip install pytest pytest-cov
python -m pip install pytest
- name: Install requirements
run: |
python -m pip install -r requirements.txt
- name: Run pytest
run: |
pytest -v --junitxml=test-output.xml --cov=ocspchecker --cov-report xml
pytest tests/test_ocspchecker.py -v --junitxml=test-output-${{ matrix.os }}-python${{ matrix.python-version }}.xml
- name: Upload test results
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # tag=v3.1.2
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # tag=v4.4.3
with:
name: pytest-results for ${{ matrix.python-version }}
path: "**/test-output.xml"
- name: Upload coverage results
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # tag=v3.1.2
with:
name: pytest-results for ${{ matrix.python-version }}
path: "**/coverage.xml"
name: pytest-results for ${{ matrix.os }}-python${{ matrix.python-version }}
path: "**/test-output-${{ matrix.os }}-python${{ matrix.python-version }}.xml"
# - name: Upload coverage results
# uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # tag=v4.4.3
# with:
# name: pytest-results for ${{ matrix.python-version }}
# path: "**/coverage.xml"
if: ${{ always() }}

build:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag=v3.3.0
- name: Set up Python 3.x
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # tag=v4.7.1
with:
python-version: "3.9"
architecture: "x64"
- name: Install tools
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install build twine
- name: Build pypy package
run: |
python -m build
- name: Check package description
run: |
twine check dist/*
- name: Generate provenance
uses: slsa-framework/[email protected]
with:
artifact_path: dist/
- name: Upload provenance
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # tag=v3.1.2
with:
name: OCSP-Checker provenance
path: build.provenance
# build:
# runs-on: ubuntu-latest
# needs: test
# steps:
# - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag=v3.3.0
# - name: Set up Python 3.x
# uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # tag=v4.7.1
# with:
# python-version: "3.9"
# architecture: "x64"
# - name: Install tools
# run: |
# python -m pip install --upgrade pip setuptools wheel
# python -m pip install build twine
# - name: Build pypy package
# run: |
# python -m build
# - name: Check package description
# run: |
# twine check dist/*
# - name: Generate provenance
# uses: slsa-framework/[email protected]
# with:
# artifact_path: dist/
# - name: Upload provenance
# uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # tag=v3.1.2
# with:
# name: OCSPChecker provenance
# path: build.provenance
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,10 @@
- allow usage of http proxy to request both host certificate and perform the ocsp request
- allow configuration of request timeouts as function argument
- add extra info in unknown exceptions

# v1.9.14
- allow custom path to ca-certs via @vLabayen
- update devcontainer
- fix flaky tests
- update CI
- remove support for Python 3.7
36 changes: 15 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
# Usually you do not have to specify amd64, but on an Apple M1 you do if you want to use packages
# that are not optimized for arm64 like NaSSL
FROM --platform=amd64 python:3.11.1-slim-bullseye
FROM --platform=amd64 mcr.microsoft.com/devcontainers/python:3.12-bullseye

SHELL ["/bin/bash", "--login", "-c"]
#SHELL ["/bin/bash", "--login", "-c"]

ENV DEBIAN_FRONTEND noninteractive
ENV LANG C.UTF-8
#ENV DEBIAN_FRONTEND noninteractive
#ENV LANG C.UTF-8

RUN useradd -m ocspdev
#RUN useradd -m ocspdev

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
netbase \
curl \
git \
bash-completion \
&& rm -rf /var/lib/apt/lists/*
#RUN apt-get update && apt-get install -y --no-install-recommends \
# ca-certificates \
# netbase \
# curl \
# git \
# bash-completion \
# && rm -rf /var/lib/apt/lists/*

RUN pip install --no-cache-dir --quiet --upgrade pip setuptools wheel \
pip install --no-cache-dir --quiet pytest pytest-cov && \
pip install --no-cache-dir --quiet twine && \
pip install --no-cache-dir --quiet pylint && \
pip install --no-cache-dir --quiet black

USER ocspdev
WORKDIR /home/ocspdev
#USER ocspdev
WORKDIR /home/vscode

# Copy OcspChecker Folder
COPY --chown=ocspdev:ocspdev . /home/ocspdev/OcspChecker/
COPY --chown=vscode:vscode . /home/vscode/OcspChecker/

CMD [ "bash" ]
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# OCSP-Checker
# OCSPChecker

[![Downloads](https://pepy.tech/badge/ocsp-checker/month)](https://pepy.tech/project/ocsp-checker)
[![PyPI Version](https://img.shields.io/pypi/v/ocsp-checker.svg)](https://pypi.org/project/ocsp-checker/)
[![Python version](https://img.shields.io/pypi/pyversions/ocsp-checker.svg)](https://pypi.org/project/ocsp-checker/)

## Overview

OCSP-Checker is a python package based on Alban Diquet's [nassl](https://github.com/nabla-c0d3/nassl) wrapper and the Python Cryptographic Authority's [cryptography](https://github.com/pyca/cryptography) package. Relying on a web browser to check the revocation status of a x509 digital certificate [has](https://www.imperialviolet.org/2014/04/19/revchecking.html) [been](https://www.imperialviolet.org/2014/04/29/revocationagain.html) [broken](https://scotthelme.co.uk/revocation-is-broken/) from the beginning, and validating certificates outside of the web browser is a manual process. OCSP-Checker aims to solve this by providing an automated means to check the [OCSP](https://en.wikipedia.org/wiki/Online_Certificate_Status_Protocol) revocation status for a x509 digital certificate.
OCSPChecker is a python package based on Alban Diquet's [nassl](https://github.com/nabla-c0d3/nassl) wrapper and the Python Cryptographic Authority's [cryptography](https://github.com/pyca/cryptography) package. Relying on a web browser to check the revocation status of a x509 digital certificate [has](https://www.imperialviolet.org/2014/04/19/revchecking.html) [been](https://www.imperialviolet.org/2014/04/29/revocationagain.html) [broken](https://scotthelme.co.uk/revocation-is-broken/) from the beginning, and validating certificates outside of the web browser is a manual process. OCSP-Checker aims to solve this by providing an automated means to check the [OCSP](https://en.wikipedia.org/wiki/Online_Certificate_Status_Protocol) revocation status for a x509 digital certificate.


## Pre-requisites

__Python__ - Python 3.7 (64-bit) and above.
__Python__ - Python 3.8 (64-bit) and above.

## Installation

Expand Down Expand Up @@ -46,7 +46,7 @@ PLEASE NOTE: If you run this on a network with a MITM SSL proxy, you may receive

## Command Line Usage

OCSP-Checker can now be used at the command line. The format is:
OCSPChecker can now be used at the command line. The format is:
```
usage: ocspchecker [-h] --target target [--port port]
Expand Down
8 changes: 4 additions & 4 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pytest==7.4.2
pytest==8.3.3
twine==4.0.2
pylint==2.17.2
black==23.9.1
isort==5.12.0
pylint==3.3.1
black==24.10.0
isort==5.13.2
4 changes: 2 additions & 2 deletions ocspchecker/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
""" __init__.py """

__title__ = "ocsp-checker"
__version__ = "1.9.13"
__title__ = "ocspchecker"
__version__ = "1.9.14"
__author__ = "Joe Gatt"

from ocspchecker.ocspchecker import get_ocsp_status
Loading

0 comments on commit c9db90c

Please sign in to comment.