Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .bandit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[bandit]
exclude_dirs = venv,build,dist,.git,__pycache__,.mypy_cache,.ruff_cache,.pytest_cache
# Skip test-related security warnings that are false positives
skips = B101,B105
# B101: assert_used - Allow assert statements (common in tests)
# B105: hardcoded_password_string - Allow hardcoded test credentials
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 10

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 5

- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 3
allow:
- dependency-name: "pre-commit"
2 changes: 2 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## Description
<!-- Describe your changes in detail -->
54 changes: 54 additions & 0 deletions .github/workflows/docker-main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Docker
permissions:
contents: read
on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-22.04
outputs:
sha-tag: ${{ steps.metadata.outputs.sha-tag }}
image: ${{ steps.metadata.outputs.image }}

steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2

- name: Login to DockerHub
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Prepare Image Metadata
id: metadata
run: |
IMAGE=pomerium/mcp-markdown
SHA_TAG=git-${GITHUB_SHA::8}
TAGS=${IMAGE}:main
TAGS=${TAGS},${IMAGE}:${SHA_TAG}
TS=$(date +%Y%m%d%H%M%S)
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
echo "timestamp=${TS}" >> $GITHUB_OUTPUT
echo "name=pomerium-mcp-markdown" >> $GITHUB_OUTPUT
echo "image=${IMAGE}" >> $GITHUB_OUTPUT
echo "sha-tag=${SHA_TAG}" >> $GITHUB_OUTPUT

- name: Docker Publish - Main
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.metadata.outputs.tags }}
labels: |
org.opencontainers.image.created=${{ steps.metadata.outputs.timestamp }}
org.opencontainers.image.name=${{ steps.metadata.outputs.name }}
org.opencontainers.image.revision=${{ github.sha }}
33 changes: 33 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Lint
permissions:
contents: read
on:
push:
branches:
- main
pull_request: {}

jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: make install

- name: Run ruff check
run: make lint-ruff

- name: Run ruff format
run: make format-check

- name: Run mypy
run: make lint-mypy

- name: Run bandit
run: make lint-bandit
21 changes: 21 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Pre-commit
permissions:
contents: read
on:
pull_request:

jobs:
pre-commit:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: make install

- name: Run pre-commit
run: make pre-commit
30 changes: 30 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test
permissions:
contents: read
on:
pull_request:

jobs:
test:
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: make install

- name: Run tests
run: make test-coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
fail_ci_if_error: false
181 changes: 181 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# ruff
# ruff is a fast Python linter, written in Rust.
.ruff_cache/

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be added to the global gitignore or merged into this project gitignore. For PyCharm
# Community Edition, use 'PyCharm CE' instead of 'PyCharm'.
.idea/

# Operating System
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Google API credentials
credentials.json
token.json
client_secrets.json

# MCP specific
*.log
.mcp/
40 changes: 40 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-toml
- id: check-merge-conflict
- id: check-added-large-files
- id: debug-statements
- id: check-docstring-first

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
hooks:
- id: mypy
additional_dependencies: [types-requests]
args: [--ignore-missing-imports, --allow-untyped-decorators]

- repo: https://github.com/pycqa/bandit
rev: 1.7.10
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]

- repo: https://github.com/python-poetry/poetry
rev: 1.8.3
hooks:
- id: poetry-check
files: pyproject.toml
pass_filenames: false
Loading