Skip to content

Commit a9396cd

Browse files
authored
Merge pull request #17 from Ontos-AI/chore/pi/python-sdk-oss-hardening
chore: harden Python SDK OSS surface
2 parents 67fc666 + e7d9779 commit a9396cd

10 files changed

Lines changed: 218 additions & 1 deletion

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Bug report
2+
description: Report a reproducible problem in the Python SDK.
3+
title: "[Bug]: "
4+
labels:
5+
- bug
6+
body:
7+
- type: textarea
8+
id: summary
9+
attributes:
10+
label: Summary
11+
description: What happened, and what did you expect instead?
12+
validations:
13+
required: true
14+
- type: input
15+
id: sdk-version
16+
attributes:
17+
label: SDK version
18+
placeholder: 0.3.1
19+
validations:
20+
required: true
21+
- type: input
22+
id: python-version
23+
attributes:
24+
label: Python version
25+
placeholder: 3.11.9
26+
validations:
27+
required: true
28+
- type: input
29+
id: os
30+
attributes:
31+
label: Operating system
32+
placeholder: macOS 15.4 / Ubuntu 24.04
33+
- type: textarea
34+
id: reproduction
35+
attributes:
36+
label: Reproduction
37+
description: Minimal code or steps to reproduce the issue.
38+
render: python
39+
validations:
40+
required: true
41+
- type: textarea
42+
id: logs
43+
attributes:
44+
label: Relevant logs or tracebacks
45+
render: text

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Knowhere documentation
4+
url: https://docs.knowhereto.ai
5+
about: Check the public docs before opening a support issue.
6+
- name: Security report
7+
url: mailto:team@knowhereto.ai?subject=Security%20report%20for%20knowhere-python-sdk
8+
about: Report vulnerabilities privately by email.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Feature request
2+
description: Propose an improvement for the Python SDK.
3+
title: "[Feature]: "
4+
labels:
5+
- enhancement
6+
body:
7+
- type: textarea
8+
id: problem
9+
attributes:
10+
label: Problem statement
11+
description: What developer problem are you trying to solve?
12+
validations:
13+
required: true
14+
- type: textarea
15+
id: proposal
16+
attributes:
17+
label: Proposed solution
18+
description: Describe the API or behavior you want to add or improve.
19+
validations:
20+
required: true
21+
- type: textarea
22+
id: alternatives
23+
attributes:
24+
label: Alternatives considered
25+
description: Describe any workarounds or alternative designs you considered.

.github/pull_request_template.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Summary
2+
3+
- describe the change
4+
- describe any public API impact
5+
6+
## Verification
7+
8+
- list the commands you ran
9+
- list any manual checks you performed
10+
11+
## Checklist
12+
13+
- [ ] Tests were added or updated when behavior changed
14+
- [ ] Public docs or examples were updated when needed
15+
- [ ] The pull request description explains any breaking or user-visible change

CODE_OF_CONDUCT.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Code of Conduct
2+
3+
We want the Knowhere Python SDK community to be respectful, constructive, and
4+
welcoming.
5+
6+
## Expected Behavior
7+
8+
- Be respectful in discussions and code review.
9+
- Assume good intent and give actionable feedback.
10+
- Focus on technical substance instead of personal attacks.
11+
- Help keep the project useful for a broad developer audience.
12+
13+
## Unacceptable Behavior
14+
15+
- Harassment, discrimination, or hateful conduct
16+
- Threats, intimidation, or doxxing
17+
- Spam, trolling, or intentionally disruptive behavior
18+
- Sharing private information without permission
19+
20+
## Enforcement
21+
22+
Maintainers may edit or remove content, close discussions, or restrict access
23+
when behavior harms the project or its contributors.
24+
25+
To report a problem, email `team@knowhereto.ai` with:
26+
27+
- the repository name
28+
- a link or screenshot if available
29+
- a short description of what happened

CONTRIBUTING.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Contributing
2+
3+
Thanks for contributing to the Knowhere Python SDK.
4+
5+
## Development Setup
6+
7+
Requirements:
8+
9+
- Python 3.9+
10+
- `uv`
11+
12+
Clone the repository and install the full development environment:
13+
14+
```bash
15+
uv sync --all-extras
16+
```
17+
18+
## Local Checks
19+
20+
Run these commands before opening a pull request:
21+
22+
```bash
23+
uv run ruff check src/
24+
uv run mypy src/knowhere
25+
uv run pytest -q
26+
```
27+
28+
If you change public behavior, also update the relevant documentation in:
29+
30+
- `README.md`
31+
- `docs/usage.md`
32+
- `examples/`
33+
34+
## Pull Requests
35+
36+
Please keep pull requests focused and easy to review.
37+
38+
Recommended checklist:
39+
40+
1. Add or update tests for behavior changes.
41+
2. Keep public types and examples in sync with the implementation.
42+
3. Document any breaking or user-visible changes in the pull request description.
43+
44+
Maintainers handle versioning and release automation through GitHub Actions.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Knowhere Team
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.

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,12 @@ We publish stable releases to [PyPI](https://pypi.org/project/knowhere-python-sd
273273
- [pydantic](https://docs.pydantic.dev/) `>=2.0.0,<3.0`
274274
- [typing-extensions](https://pypi.org/project/typing-extensions/) `>=4.7.0`
275275

276+
## Community
277+
278+
- Contributing guide: [CONTRIBUTING.md](./CONTRIBUTING.md)
279+
- Security policy: [SECURITY.md](./SECURITY.md)
280+
- Code of conduct: [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md)
281+
276282
## License
277283

278284
MIT

SECURITY.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
Only the latest published release line is supported for security fixes.
6+
7+
| Version | Supported |
8+
| --- | --- |
9+
| Latest release | Yes |
10+
| Older releases | No |
11+
12+
## Reporting a Vulnerability
13+
14+
Please do not open public GitHub issues for suspected vulnerabilities.
15+
16+
Instead, email `team@knowhereto.ai` with:
17+
18+
- the repository name
19+
- a clear description of the issue
20+
- reproduction steps or a proof of concept
21+
- impact assessment if known
22+
23+
We will acknowledge the report, validate it, and coordinate remediation before
24+
public disclosure.

tests/test_logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class TestRedactSensitiveHeaders:
1818

1919
def test_redacts_authorization_bearer(self) -> None:
2020
headers: Dict[str, str] = {
21-
"Authorization": "Bearer sk_live_abc123xyz",
21+
"Authorization": "Bearer sk_example_redacted_token",
2222
"Content-Type": "application/json",
2323
}
2424
redacted: Dict[str, str] = redactSensitiveHeaders(headers)

0 commit comments

Comments
 (0)