conan-auth-source-plugin 0.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- conan_auth_source_plugin-0.0.5/.conanignore +14 -0
- conan_auth_source_plugin-0.0.5/.editorconfig +5 -0
- conan_auth_source_plugin-0.0.5/.github/workflows/publish.yml +50 -0
- conan_auth_source_plugin-0.0.5/.github/workflows/pylint.yml +32 -0
- conan_auth_source_plugin-0.0.5/.gitignore +218 -0
- conan_auth_source_plugin-0.0.5/.idea/.gitignore +13 -0
- conan_auth_source_plugin-0.0.5/.idea/.name +1 -0
- conan_auth_source_plugin-0.0.5/.idea/conan-auth-source-plugin.iml +13 -0
- conan_auth_source_plugin-0.0.5/.idea/modules.xml +8 -0
- conan_auth_source_plugin-0.0.5/.idea/vcs.xml +6 -0
- conan_auth_source_plugin-0.0.5/.pylintrc +18 -0
- conan_auth_source_plugin-0.0.5/LICENSE +21 -0
- conan_auth_source_plugin-0.0.5/PKG-INFO +164 -0
- conan_auth_source_plugin-0.0.5/README.md +147 -0
- conan_auth_source_plugin-0.0.5/extensions/plugins/auth_source.py +28 -0
- conan_auth_source_plugin-0.0.5/pyproject.toml +21 -0
- conan_auth_source_plugin-0.0.5/requirements.txt +58 -0
- conan_auth_source_plugin-0.0.5/setup.cfg +4 -0
- conan_auth_source_plugin-0.0.5/setup.py +35 -0
- conan_auth_source_plugin-0.0.5/src/auth_source/__init__.py +0 -0
- conan_auth_source_plugin-0.0.5/src/auth_source/auth_source_plugin.py +45 -0
- conan_auth_source_plugin-0.0.5/src/auth_source/authenticator.py +52 -0
- conan_auth_source_plugin-0.0.5/src/auth_source/config.py +81 -0
- conan_auth_source_plugin-0.0.5/src/auth_source/installer.py +55 -0
- conan_auth_source_plugin-0.0.5/src/auth_source/source_credentials.py +42 -0
- conan_auth_source_plugin-0.0.5/src/auth_source/types.py +38 -0
- conan_auth_source_plugin-0.0.5/src/conan_auth_source_plugin.egg-info/PKG-INFO +164 -0
- conan_auth_source_plugin-0.0.5/src/conan_auth_source_plugin.egg-info/SOURCES.txt +39 -0
- conan_auth_source_plugin-0.0.5/src/conan_auth_source_plugin.egg-info/dependency_links.txt +1 -0
- conan_auth_source_plugin-0.0.5/src/conan_auth_source_plugin.egg-info/entry_points.txt +2 -0
- conan_auth_source_plugin-0.0.5/src/conan_auth_source_plugin.egg-info/requires.txt +3 -0
- conan_auth_source_plugin-0.0.5/src/conan_auth_source_plugin.egg-info/scm_file_list.json +35 -0
- conan_auth_source_plugin-0.0.5/src/conan_auth_source_plugin.egg-info/scm_version.json +8 -0
- conan_auth_source_plugin-0.0.5/src/conan_auth_source_plugin.egg-info/top_level.txt +2 -0
- conan_auth_source_plugin-0.0.5/test/micro/test_config.py +46 -0
- conan_auth_source_plugin-0.0.5/test/micro/test_source_credentials_json.py +36 -0
- conan_auth_source_plugin-0.0.5/test/sample/.conanignore +3 -0
- conan_auth_source_plugin-0.0.5/test/sample/.gitignore +7 -0
- conan_auth_source_plugin-0.0.5/test/sample/README.md +64 -0
- conan_auth_source_plugin-0.0.5/test/sample/conanfile.py +16 -0
- conan_auth_source_plugin-0.0.5/test/sample/source_credentials.json +14 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: Publish Python Package to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
# Least privilege: the workflow only needs to read the repo.
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build-and-publish:
|
|
14
|
+
name: Build distribution
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
# Required for Trusted Publishing
|
|
18
|
+
environment:
|
|
19
|
+
name: pypi
|
|
20
|
+
url: https://pypi.org/p/conan-auth-source-plugin
|
|
21
|
+
permissions:
|
|
22
|
+
id-token: write # MANDATORY: Allows GitHub to request the OIDC token from PyPI
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
# https://github.com/actions/checkout
|
|
26
|
+
- name: Checkout code
|
|
27
|
+
uses: actions/checkout@v7
|
|
28
|
+
with:
|
|
29
|
+
fetch-depth: 0 # setuptools_scm needs tags/history so the version tag can be used
|
|
30
|
+
|
|
31
|
+
# https://github.com/actions/setup-python
|
|
32
|
+
- name: Set up Python
|
|
33
|
+
uses: actions/setup-python@v6
|
|
34
|
+
with:
|
|
35
|
+
python-version: "3.14"
|
|
36
|
+
|
|
37
|
+
- name: Install build tooling
|
|
38
|
+
run: |
|
|
39
|
+
python -m pip install --upgrade pip
|
|
40
|
+
pip install -r requirements.txt
|
|
41
|
+
|
|
42
|
+
- name: Build source and wheel distributions
|
|
43
|
+
run: python -m build
|
|
44
|
+
|
|
45
|
+
- name: Check distribution metadata
|
|
46
|
+
run: twine check dist/*
|
|
47
|
+
|
|
48
|
+
# https://github.com/pypa/gh-action-pypi-publish
|
|
49
|
+
- name: Publish package distributions to PyPI
|
|
50
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Pylint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- '**'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
python-version: ["3.14"]
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
# https://github.com/actions/checkout
|
|
17
|
+
- uses: actions/checkout@v7
|
|
18
|
+
|
|
19
|
+
# https://github.com/actions/setup-python
|
|
20
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
21
|
+
uses: actions/setup-python@v6
|
|
22
|
+
with:
|
|
23
|
+
python-version: ${{ matrix.python-version }}
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: |
|
|
27
|
+
python -m pip install --upgrade pip
|
|
28
|
+
pip install -r requirements.txt
|
|
29
|
+
|
|
30
|
+
- name: Analysing the code with pylint
|
|
31
|
+
run: |
|
|
32
|
+
pylint $(git ls-files '*.py') --fail-under=9
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
# Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
# poetry.lock
|
|
109
|
+
# poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
# pdm.lock
|
|
116
|
+
# pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
# pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# Redis
|
|
135
|
+
*.rdb
|
|
136
|
+
*.aof
|
|
137
|
+
*.pid
|
|
138
|
+
|
|
139
|
+
# RabbitMQ
|
|
140
|
+
mnesia/
|
|
141
|
+
rabbitmq/
|
|
142
|
+
rabbitmq-data/
|
|
143
|
+
|
|
144
|
+
# ActiveMQ
|
|
145
|
+
activemq-data/
|
|
146
|
+
|
|
147
|
+
# SageMath parsed files
|
|
148
|
+
*.sage.py
|
|
149
|
+
|
|
150
|
+
# Environments
|
|
151
|
+
.env
|
|
152
|
+
.envrc
|
|
153
|
+
.venv
|
|
154
|
+
env/
|
|
155
|
+
venv/
|
|
156
|
+
ENV/
|
|
157
|
+
env.bak/
|
|
158
|
+
venv.bak/
|
|
159
|
+
|
|
160
|
+
# Spyder project settings
|
|
161
|
+
.spyderproject
|
|
162
|
+
.spyproject
|
|
163
|
+
|
|
164
|
+
# Rope project settings
|
|
165
|
+
.ropeproject
|
|
166
|
+
|
|
167
|
+
# mkdocs documentation
|
|
168
|
+
/site
|
|
169
|
+
|
|
170
|
+
# mypy
|
|
171
|
+
.mypy_cache/
|
|
172
|
+
.dmypy.json
|
|
173
|
+
dmypy.json
|
|
174
|
+
|
|
175
|
+
# Pyre type checker
|
|
176
|
+
.pyre/
|
|
177
|
+
|
|
178
|
+
# pytype static type analyzer
|
|
179
|
+
.pytype/
|
|
180
|
+
|
|
181
|
+
# Cython debug symbols
|
|
182
|
+
cython_debug/
|
|
183
|
+
|
|
184
|
+
# PyCharm
|
|
185
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
186
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
188
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
189
|
+
# .idea/
|
|
190
|
+
|
|
191
|
+
# Abstra
|
|
192
|
+
# Abstra is an AI-powered process automation framework.
|
|
193
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
194
|
+
# Learn more at https://abstra.io/docs
|
|
195
|
+
.abstra/
|
|
196
|
+
|
|
197
|
+
# Visual Studio Code
|
|
198
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
199
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
200
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
201
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
202
|
+
# .vscode/
|
|
203
|
+
# Temporary file for partial code execution
|
|
204
|
+
tempCodeRunnerFile.py
|
|
205
|
+
|
|
206
|
+
# Ruff stuff:
|
|
207
|
+
.ruff_cache/
|
|
208
|
+
|
|
209
|
+
# PyPI configuration file
|
|
210
|
+
.pypirc
|
|
211
|
+
|
|
212
|
+
# Marimo
|
|
213
|
+
marimo/_static/
|
|
214
|
+
marimo/_lsp/
|
|
215
|
+
__marimo__/
|
|
216
|
+
|
|
217
|
+
# Streamlit
|
|
218
|
+
.streamlit/secrets.toml
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Default ignored files
|
|
2
|
+
/shelf/
|
|
3
|
+
/workspace.xml
|
|
4
|
+
# Editor-based HTTP Client requests
|
|
5
|
+
/httpRequests/
|
|
6
|
+
# Ignored default folder with query files
|
|
7
|
+
/queries/
|
|
8
|
+
# Datasource local storage ignored files
|
|
9
|
+
/dataSources/
|
|
10
|
+
/dataSources.local.xml
|
|
11
|
+
|
|
12
|
+
/inspectionProfiles/profiles_settings.xml
|
|
13
|
+
/inspectionProfiles/Project_Default.xml
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
conan-auth-source-plugin
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="PYTHON_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$">
|
|
5
|
+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
|
6
|
+
<sourceFolder url="file://$MODULE_DIR$/test/micro" isTestSource="true" />
|
|
7
|
+
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
|
8
|
+
<excludeFolder url="file://$MODULE_DIR$/src/conan_auth_source_plugin.egg-info" />
|
|
9
|
+
</content>
|
|
10
|
+
<orderEntry type="jdk" jdkName="Python" jdkType="Python SDK" />
|
|
11
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
12
|
+
</component>
|
|
13
|
+
</module>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/conan-auth-source-plugin.iml" filepath="$PROJECT_DIR$/.idea/conan-auth-source-plugin.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
[MASTER]
|
|
3
|
+
# This directory contains example python that doesn't need to be linted.
|
|
4
|
+
ignore-paths=
|
|
5
|
+
.*test/micro/.*
|
|
6
|
+
.*test/sample/.*
|
|
7
|
+
|
|
8
|
+
[MAIN]
|
|
9
|
+
load-plugins = pylint_per_file_ignores
|
|
10
|
+
|
|
11
|
+
[FORMAT]
|
|
12
|
+
max-line-length = 120
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
[MESSAGES CONTROL]
|
|
16
|
+
# Allow tests classes to have a single test method
|
|
17
|
+
per-file-ignores =
|
|
18
|
+
**/test_*.py:too-few-public-methods
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Utilties, plugins and extesions for Conan package management
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: conan-auth-source-plugin
|
|
3
|
+
Version: 0.0.5
|
|
4
|
+
Summary: A python module to provide GitHub application authorisation for source downloads
|
|
5
|
+
Requires-Python: >=3.13
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: conan<3.0,>=2.25
|
|
9
|
+
Requires-Dist: packaging>=26.2
|
|
10
|
+
Requires-Dist: PyGithub>=2.9.1
|
|
11
|
+
Dynamic: description
|
|
12
|
+
Dynamic: description-content-type
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
Dynamic: requires-dist
|
|
15
|
+
Dynamic: requires-python
|
|
16
|
+
Dynamic: summary
|
|
17
|
+
|
|
18
|
+
# [conan-auth-source-plugin](https://github.com/conan-py/conan-auth-source-plugin)
|
|
19
|
+
|
|
20
|
+
A Conan authentication source plugin, implemented as a python module. Conan supports both a *remote*
|
|
21
|
+
and a *source* authentication, where the remotes are used for interacting with a remote for
|
|
22
|
+
packages, whereas the *source* is used for getting source using the `get()` or `download()`
|
|
23
|
+
method in a `conanfile.py`.
|
|
24
|
+
|
|
25
|
+
# Installation
|
|
26
|
+
|
|
27
|
+
Install the conan authentication source Python module, then install the plugin in that module
|
|
28
|
+
into the conan installation.
|
|
29
|
+
|
|
30
|
+
```shell
|
|
31
|
+
python -m pip install conan-auth-source-plugin
|
|
32
|
+
conan-auth-source-plugin-install
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
# Configuration
|
|
36
|
+
|
|
37
|
+
This plugin uses the
|
|
38
|
+
[`source_creditials.json`](https://docs.conan.io/2/reference/config_files/source_credentials.html)
|
|
39
|
+
file for configuration. This file is marked as experimental at this stage. This module further
|
|
40
|
+
experiments and extends its usage.
|
|
41
|
+
|
|
42
|
+
**Note**: The conan source configuration code uses a first match (begins with) strategy with URLs.
|
|
43
|
+
Thus, it is important to order the credentials in longest url first if there is any overlap in
|
|
44
|
+
matching the URL being fetched with the configuration.
|
|
45
|
+
|
|
46
|
+
## Sample
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"credentials": [
|
|
51
|
+
{
|
|
52
|
+
"url": "https://github.com/...",
|
|
53
|
+
"type": "github.app",
|
|
54
|
+
"app_id": "4459267",
|
|
55
|
+
"app_installation_id": "150620648",
|
|
56
|
+
"app_private_key" : "-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
# Create App
|
|
63
|
+
|
|
64
|
+
The following procedure can be used to create an application in github. This procedure requires an
|
|
65
|
+
organisation owner, or a team member with app management permissions.
|
|
66
|
+
|
|
67
|
+
This procedure is documented as a GitHub app that act on their
|
|
68
|
+
[own behalf](https://docs.github.com/en/apps/creating-github-apps/about-creating-github-apps/about-creating-github-apps#github-apps-that-act-on-their-own-behalf).
|
|
69
|
+
This requires an installation access token for authentication.
|
|
70
|
+
|
|
71
|
+
1. Go to the organisation (or user) settings
|
|
72
|
+
|
|
73
|
+
https://github.com/organizations/conan-py/settings/apps
|
|
74
|
+
https://github.com/<org name>/conan-py/settings/apps
|
|
75
|
+
|
|
76
|
+
2. App settings
|
|
77
|
+
|
|
78
|
+
- provide a github app name
|
|
79
|
+
- write a description
|
|
80
|
+
- add a homepage URL (e.g. to the organisation landing page), even though it isn't explicitly used
|
|
81
|
+
- disable web hook
|
|
82
|
+
- add repository permission 'Contents', set to 'Read-Only'
|
|
83
|
+
|
|
84
|
+
3. Once the app is created, the 'App ID' and the 'Client ID' (not used for this workflow) are known
|
|
85
|
+
|
|
86
|
+
4. Go to the bottom of the application and generate a private key. This will
|
|
87
|
+
generate a 2048bit RSA key pair without a pass phrase.
|
|
88
|
+
|
|
89
|
+
5. On the side bar of the application, select the "Install App" menu item. Once installed
|
|
90
|
+
the installation id can be taken from the installation URL. For example if the installation
|
|
91
|
+
URL is 'https://github.com/organizations/conan-py/settings/installations/150620648', then the
|
|
92
|
+
installation id is 150620648. The installation id is not displayed in the web UI of github.
|
|
93
|
+
|
|
94
|
+
# Why use this plugin module
|
|
95
|
+
|
|
96
|
+
This module is a shift-left style strategy for authentication. Instead of using this pluing
|
|
97
|
+
a build pipeline (or any Conan build) can pre-authenticate with all github organisation/repositores
|
|
98
|
+
that *may* be needed during a build.
|
|
99
|
+
|
|
100
|
+
This module goes half-way towards "authentication on demand". This is a concept where http
|
|
101
|
+
authentication is only attempted by a client if a
|
|
102
|
+
[401 (Not authenticated)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/401)
|
|
103
|
+
response is received, and the
|
|
104
|
+
[`WWW-Authenticate` header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/WWW-Authenticate)
|
|
105
|
+
provides
|
|
106
|
+
[authentication schemes](https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml)
|
|
107
|
+
that are semantically understood by the client. Once authenticated the client should reissue the
|
|
108
|
+
http request with the new credentials.
|
|
109
|
+
|
|
110
|
+
*Residual*: This plugin does not defer authentication until after it is needed. This is not
|
|
111
|
+
supported by the Conan client.
|
|
112
|
+
|
|
113
|
+
# Known issues
|
|
114
|
+
|
|
115
|
+
- this implementation stores private keys by value in memory. e.g. if using AWS it
|
|
116
|
+
would be better to use a HSM or AWS KMS, but this would require an implementation
|
|
117
|
+
of the `github.Auth.Auth` class. Using AWS Secrets Manager at least stores the
|
|
118
|
+
key more securely at rest, even though it will be stored in memory non-securely.
|
|
119
|
+
|
|
120
|
+
- when using the `get()` method in a `conanfile.py`, provide a filename parameter
|
|
121
|
+
with a representative name (e.g. 'archive.tgz') so that conan can write the download
|
|
122
|
+
to disk. The filename should be expressed in the `conandat.yml`.
|
|
123
|
+
|
|
124
|
+
# Development
|
|
125
|
+
|
|
126
|
+
To install the plugin in a local Conan environment, the whole of the plugin repository
|
|
127
|
+
can be installed, as the `.conanignore` will exclude everything except the plugin
|
|
128
|
+
python file that thunks to the module.
|
|
129
|
+
|
|
130
|
+
```shell
|
|
131
|
+
conan config install .
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Install the plugin Python for development as an editable module. From the root of the
|
|
135
|
+
repository/project:
|
|
136
|
+
|
|
137
|
+
```shell
|
|
138
|
+
pip install --editable .
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
# Links
|
|
142
|
+
|
|
143
|
+
- https://pypi.org/project/conan-auth-source-plugin
|
|
144
|
+
- https://github.com/conan-io/conan-extensions/tree/main
|
|
145
|
+
- https://docs.conan.io/2/reference/extensions/authorization_plugins.html
|
|
146
|
+
- https://docs.conan.io/2/reference/config_files/source_credentials.html
|
|
147
|
+
- https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app
|
|
148
|
+
- https://docs.github.com/apps/creating-github-apps/about-creating-github-apps/about-creating-github-apps
|
|
149
|
+
|
|
150
|
+
## pygithub
|
|
151
|
+
|
|
152
|
+
- https://github.com/PyGithub/PyGithub/tree/main
|
|
153
|
+
- https://pygithub.readthedocs.io/en/stable/introduction.html
|
|
154
|
+
|
|
155
|
+
# Appendices
|
|
156
|
+
|
|
157
|
+
## github tarball URLs
|
|
158
|
+
|
|
159
|
+
For getting source from a private github repo, use a URL/http request of the form:
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
GET https://api.github.com/repos/{owner}/{repo}/tarball/{ref}
|
|
163
|
+
Authorization: Bearer <installation_token>
|
|
164
|
+
```
|