Skip to content

Commit d63c2fd

Browse files
feat(dir-sdk-python): initial commit
Signed-off-by: Bendegúz Csirmaz <csirmazbendeguz@gmail.com>
1 parent fb536aa commit d63c2fd

36 files changed

Lines changed: 3862 additions & 204 deletions

.github/CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
####################################################
22
#
3-
# List of approvers for <project-name> project
3+
# List of approvers for the Directory Python SDK project
44
#
55
#####################################################
66
#
@@ -12,8 +12,8 @@
1212
# the repository. Unless a later match takes precedence,
1313
# the following users/teams will be requested for
1414
# review when someone opens a pull request.
15-
* @agntcy/<maintainer-team-name>
15+
* @agntcy/dir-maintainers
1616

1717
# Enforces admin protections for repo configuration via probot settings app.
1818
# ref: https://github.com/probot/settings#security-implications
19-
.github/settings.yml @agntcy/<admin-team-name>
19+
.github/settings.yml @agntcy/dir-maintainers

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ body:
3030
If applicable, provide the version number or release tag where this
3131
issue was encountered
3232
options:
33-
- v1.0.0
34-
- v1.0.1
35-
- v1.0.2
36-
- v1.0.3
33+
- v0.0.1
3734
default: 0
3835
validations:
3936
required: false
@@ -55,7 +52,7 @@ body:
5552
label: Checklist
5653
description: By submitting this issue, you agree to the following
5754
options:
58-
- label: I have read the [contributing guidelines](/agntcy/repo-template/blob/main/CONTRIBUTING.md)
55+
- label: I have read the [contributing guidelines](/agntcy/dir-sdk-python/blob/main/CONTRIBUTING.md)
5956
required: true
6057
- label: I have verified this does not duplicate an existing issue
6158
required: true

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ body:
4848
label: Checklist
4949
description: By submitting this request, you agree to the following
5050
options:
51-
- label: I have read the [contributing guidelines](/agntcy/repo-template/blob/main/CONTRIBUTING.md)
51+
- label: I have read the [contributing guidelines](/agntcy/dir-sdk-python/blob/main/CONTRIBUTING.md)
5252
required: true
5353
- label: |
5454
I have verified this does not duplicate an existing feature request

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ much longer to review, or result in it not being reviewed at all.
1919

2020
## Checklist
2121

22-
- [ ] I have read the [contributing guidelines](/agntcy/repo-template/blob/main/CONTRIBUTING.md)
22+
- [ ] I have read the [contributing guidelines](/agntcy/dir-sdk-python/blob/main/CONTRIBUTING.md)
2323
- [ ] Existing issues have been referenced (where applicable)
2424
- [ ] I have verified this change is not present in other open pull requests
2525
- [ ] Functionality is documented

.github/settings.yml

Lines changed: 54 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ repository:
55
# See https://developer.github.com/v3/repos/#edit for all available settings.
66

77
# The name of the repository. Changing this will rename the repository
8-
name: repo-template
8+
name: dir-sdk-python
99

1010
# A short description of the repository that will show up on GitHub
11-
description: Agntcy Project Repo Template
11+
description: Directory Python SDK
1212

1313
# A URL with more information about the repository
14-
homepage: https://www.example.com
14+
homepage: https://docs.agntcy.org/dir/directory-sdk/#python-sdk
1515

1616
# A comma-separated list of topics to set on the repository
1717
topics: github, probot
@@ -60,60 +60,56 @@ repository:
6060

6161
# TODO: Enable this section once GitHub teams have been created & granted access to this repository
6262
# See https://developer.github.com/v3/teams/#add-or-update-team-repository for options
63-
# teams:
64-
# # The permission to grant the team. Can be one of:
65-
# # * `pull` - can pull, but not push to or administer this repository.
66-
# # * `push` - can pull and push, but not administer this repository.
67-
# # * `admin` - can pull, push and administer this repository.
68-
# # * `maintain` - Recommended for project managers who need to manage the
69-
# # repository without access to sensitive or destructive actions.
70-
# # * `triage` - Recommended for contributors who need to proactively manage
71-
# # issues and pull requests without write access.
72-
# - name: <project-name-admins>
73-
# permission: admin
74-
# - name: <project-name-maintainers>
75-
# permission: maintain
76-
# - name: <project-name>
77-
# permission: triage
63+
teams:
64+
# The permission to grant the team. Can be one of:
65+
# * `pull` - can pull, but not push to or administer this repository.
66+
# * `push` - can pull and push, but not administer this repository.
67+
# * `admin` - can pull, push and administer this repository.
68+
# * `maintain` - Recommended for project managers who need to manage the
69+
# repository without access to sensitive or destructive actions.
70+
# * `triage` - Recommended for contributors who need to proactively manage
71+
# issues and pull requests without write access.
72+
- name: dir-maintainers
73+
permission: admin
7874

7975
# TODO: Enable this section once repository has been created & no further modifications are needed
80-
# branches:
81-
# - name: main
82-
# # https://developer.github.com/v3/repos/branches/#update-branch-protection
83-
# # Branch Protection settings. Set to null to disable
84-
# protection:
85-
# # Required. Require at least one approving review on a pull request,
86-
# # before merging. Set to null to disable.
87-
# required_pull_request_reviews:
88-
# # The number of approvals required. (1-6)
89-
# required_approving_review_count: 1
90-
# # Dismiss approved reviews automatically when a new commit is pushed.
91-
# dismiss_stale_reviews: true
92-
# # Blocks merge until code owners have reviewed.
93-
# require_code_owner_reviews: true
94-
# # Specify which users and teams can dismiss pull request reviews. Pass
95-
# # an empty dismissal_restrictions object to disable. User and team
96-
# # dismissal_restrictions are only available for organization-owned
97-
# # repositories. Omit this parameter for personal repositories.
98-
# dismissal_restrictions:
99-
# users: []
100-
# teams: []
101-
# # Required. Require status checks to pass before merging. Set to null to disable
102-
# required_status_checks:
103-
# # Required. Require branches to be up to date before merging.
104-
# strict: true
105-
# # Required. The list of required status checks in order to merge into this branch
106-
# contexts: []
107-
# # Required. Enforce all configured restrictions for administrators. Set to
108-
# # true to enforce required status checks for repository administrators.
109-
# # Set to null to disable.
110-
# enforce_admins: true
111-
# # Prevent merge commits from being pushed to matching branches
112-
# required_linear_history: true
113-
# # Required. Restrict who can push to this branch. Team and user
114-
# # restrictions are only available for organization-owned repositories. Set
115-
# # to null to disable.
116-
# restrictions:
117-
# apps: []
118-
# users: []
119-
# teams: []
76+
branches:
77+
- name: main
78+
# https://developer.github.com/v3/repos/branches/#update-branch-protection
79+
# Branch Protection settings. Set to null to disable
80+
protection:
81+
# Required. Require at least one approving review on a pull request,
82+
# before merging. Set to null to disable.
83+
required_pull_request_reviews:
84+
# The number of approvals required. (1-6)
85+
required_approving_review_count: 1
86+
# Dismiss approved reviews automatically when a new commit is pushed.
87+
dismiss_stale_reviews: true
88+
# Blocks merge until code owners have reviewed.
89+
require_code_owner_reviews: true
90+
# Specify which users and teams can dismiss pull request reviews. Pass
91+
# an empty dismissal_restrictions object to disable. User and team
92+
# dismissal_restrictions are only available for organization-owned
93+
# repositories. Omit this parameter for personal repositories.
94+
dismissal_restrictions:
95+
users: []
96+
teams: []
97+
# Required. Require status checks to pass before merging. Set to null to disable
98+
required_status_checks:
99+
# Required. Require branches to be up to date before merging.
100+
strict: true
101+
# Required. The list of required status checks in order to merge into this branch
102+
contexts: []
103+
# Required. Enforce all configured restrictions for administrators. Set to
104+
# true to enforce required status checks for repository administrators.
105+
# Set to null to disable.
106+
enforce_admins: true
107+
# Prevent merge commits from being pushed to matching branches
108+
required_linear_history: true
109+
# Required. Restrict who can push to this branch. Team and user
110+
# restrictions are only available for organization-owned repositories. Set
111+
# to null to disable.
112+
restrictions:
113+
apps: []
114+
users: []
115+
teams: []

.github/workflows/dependency.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
name: dependency
33

4-
on:
5-
# Review dependencies on pull requests to the default branch
6-
pull_request:
7-
branches: ["main"]
4+
# TODO: enable dependency review after migration
5+
# on:
6+
# # Review dependencies on pull requests to the default branch
7+
# pull_request:
8+
# branches: ["main"]
89

910
# Declare default permissions as read-only
1011
permissions: read-all

.github/workflows/lint.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
22
name: lint
33

4-
on:
5-
push:
6-
# Run superlinter on pushes to default branch
7-
branches:
8-
- main
9-
# Run superlinter on pull request events
10-
pull_request:
4+
# TODO: enable linter after migration
5+
# on:
6+
# push:
7+
# # Run superlinter on pushes to default branch
8+
# branches:
9+
# - main
10+
# # Run superlinter on pull request events
11+
# pull_request:
1112

1213
# Declare default permissions as read-only
1314
permissions: read-all
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Copyright AGNTCY Contributors (https://github.com/agntcy)
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Test SDK
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
image_repo:
10+
required: true
11+
type: string
12+
description: "Image repo to use."
13+
image_tag:
14+
required: true
15+
type: string
16+
description: "Image tag to use."
17+
18+
permissions:
19+
id-token: write
20+
contents: read
21+
22+
jobs:
23+
python:
24+
name: Python
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29+
with:
30+
fetch-depth: 0
31+
32+
- name: Login to ghcr.io
33+
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
34+
with:
35+
registry: ghcr.io
36+
username: notused
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Install Task
40+
uses: go-task/setup-task@3be4020d41929789a01026e0e427a4321ce0ad44 #v2.0.0
41+
42+
- name: Download artifacts
43+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
44+
with:
45+
path: tmp/artifacts
46+
merge-multiple: true
47+
48+
- name: Load images to local Docker registry
49+
run: |
50+
for image_archive in tmp/artifacts/*.tar; do
51+
docker load --input "$image_archive"
52+
done
53+
docker images
54+
55+
- name: Load compiled dirctl binary
56+
run: |
57+
task deps:bin-dir
58+
cp tmp/artifacts/dirctl ./.bin/dirctl
59+
chmod +x ./.bin/dirctl
60+
61+
- name: Add dependencies for SDKs testing
62+
env:
63+
CLIENT_ID: "https://github.com/${{ github.repository }}/.github/workflows/reusable-test-sdk.yaml@${{ github.ref }}"
64+
run: |
65+
TRY_SKIP_COMPILE=true task sdk:deps:common
66+
task sdk:deps:cicd:iodc-token-generation >> $GITHUB_ENV
67+
68+
- name: Test Python SDK
69+
env:
70+
IMAGE_REPO: ${{ inputs.image_repo }}
71+
IMAGE_TAG: ${{ inputs.image_tag }}
72+
run: |
73+
task sdk:test:python

.gitignore

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# IDEs
2+
.vscode/
3+
.idea/
4+
.continue/
5+
6+
# Secrets
7+
.env
8+
.envrc
9+
10+
# Builds
11+
.bin/
12+
13+
# Python
14+
dist/
15+
__pycache__/
16+
*.egg-info
17+
*.pyc
18+
*.pyo
19+
*.pyd
20+
.venv/
21+
22+
# JS
23+
node_modules
24+
25+
# Helm
26+
install/charts/dir/charts/
27+
install/charts/dir/apiserver/charts/
28+
install/charts/dirctl/charts/
29+
install/charts/envoy-authz/charts/
30+
31+
# MacOS
32+
.DS_Store
33+
34+
# Test output
35+
e2e/tmp/*
36+
37+
# Coverage output
38+
.coverage/
39+
40+
# Licensei
41+
.licensei.cache
42+
43+
tmp/
44+
45+
# AI
46+
.cursor/
47+
48+
# Go workspace files
49+
go.work
50+
go.work.sum
51+
52+
# MCP server binary
53+
mcp/mcp-server
54+
55+
# Local Build output
56+
build/
57+
mcp/debug/
58+
59+
# Flutter GUI
60+
gui/.dart_tool/
61+
gui/.flutter-plugins
62+
gui/.flutter-plugins-dependencies
63+
gui/build/
64+
gui/android/
65+
gui/ios/
66+
gui/linux/
67+
gui/web/
68+
gui/windows/
69+
gui/macos/
70+
71+
gui/.env

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

0 commit comments

Comments
 (0)