Skip to content

Commit 29b1e20

Browse files
committed
First version
1 parent a171ac4 commit 29b1e20

File tree

11 files changed

+369
-0
lines changed

11 files changed

+369
-0
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Bug Report
2+
description: Create a report to help us improve.
3+
body:
4+
- type: checkboxes
5+
id: terms
6+
attributes:
7+
label: Welcome!
8+
description: |
9+
The issue tracker is for reporting bugs and feature requests only.
10+
11+
All new/updated issues are triaged regularly by the maintainers.
12+
All issues closed by a bot are subsequently double-checked by the maintainers.
13+
14+
DO NOT FILE ISSUES FOR GENERAL SUPPORT QUESTIONS.
15+
16+
options:
17+
- label: Yes, I've searched similar issues on [GitHub](https://github.com/traefik/whoamimcp/issues) and didn't find any.
18+
required: true
19+
20+
- type: textarea
21+
attributes:
22+
label: What did you do?
23+
description: |
24+
How to write a good bug report?
25+
26+
- Respect the issue template as much as possible.
27+
- The title should be short and descriptive.
28+
- Explain the conditions which led you to report this issue: the context.
29+
- The context should lead to something, an idea or a problem that you’re facing.
30+
- Remain clear and concise.
31+
- Format your messages to help the reader focus on what matters and understand the structure of your message, use [Markdown syntax](https://help.github.com/articles/github-flavored-markdown)
32+
placeholder: What did you do?
33+
validations:
34+
required: true
35+
36+
- type: textarea
37+
attributes:
38+
label: What were you expecting?
39+
placeholder: What were you expecting?
40+
validations:
41+
required: true
42+
43+
- type: textarea
44+
attributes:
45+
label: What version are you using?
46+
description: |
47+
`latest` is not considered as a valid version.
48+
placeholder: Paste your output here.
49+
validations:
50+
required: true
51+
52+
- type: textarea
53+
attributes:
54+
label: What is your environment & configuration?
55+
description: arguments, toml, provider, platform, ...
56+
placeholder: Add information here.
57+
value: |
58+
```yaml
59+
# (paste your configuration here)
60+
```
61+
62+
Add more configuration information here.
63+
validations:
64+
required: true
65+
66+
- type: textarea
67+
attributes:
68+
label: If applicable, please paste the log output in DEBUG level
69+
description: "`--log.level=DEBUG` switch."
70+
placeholder: Paste your output here.
71+
validations:
72+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Traefik Community Support
4+
url: https://community.traefik.io/
5+
about: If you have a question, or are looking for advice, please post on our Discuss forum! The community loves to chime in to help. Happy Coding!
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Feature Request
2+
description: Suggest an idea for this project.
3+
body:
4+
- type: checkboxes
5+
id: terms
6+
attributes:
7+
label: Welcome!
8+
description: |
9+
The issue tracker is for reporting bugs and feature requests only.
10+
11+
DO NOT FILE ISSUES FOR GENERAL SUPPORT QUESTIONS.
12+
options:
13+
- label: Yes, I've searched similar issues on [GitHub](https://github.com/traefik/whoamimcp/issues) and didn't find any.
14+
required: true
15+
16+
- type: textarea
17+
attributes:
18+
label: What did you expect to see?
19+
description: |
20+
How to write a good issue?
21+
22+
- Respect the issue template as much as possible.
23+
- The title should be short and descriptive.
24+
- Explain the conditions which led you to report this issue: the context.
25+
- The context should lead to something, an idea or a problem that you’re facing.
26+
- Remain clear and concise.
27+
- Format your messages to help the reader focus on what matters and understand the structure of your message, use [Markdown syntax](https://help.github.com/articles/github-flavored-markdown)
28+
placeholder: What did you expect to see?
29+
validations:
30+
required: true

.github/workflows/ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
11+
main:
12+
name: Main Process
13+
runs-on: ubuntu-latest
14+
env:
15+
GO_VERSION: stable
16+
GOLANGCI_LINT_VERSION: v2.1.2
17+
CGO_ENABLED: 0
18+
19+
steps:
20+
21+
# https://github.com/marketplace/actions/checkout
22+
- name: Check out code
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
# https://github.com/marketplace/actions/setup-go-environment
28+
- name: Set up Go ${{ env.GO_VERSION }}
29+
uses: actions/setup-go@v5
30+
with:
31+
go-version: ${{ env.GO_VERSION }}
32+
33+
- name: Check and get dependencies
34+
run: |
35+
go mod tidy
36+
git diff --exit-code go.mod
37+
git diff --exit-code go.sum
38+
39+
# https://golangci-lint.run/usage/install#other-ci
40+
- name: Install golangci-lint ${{ env.GOLANGCI_LINT_VERSION }}
41+
run: |
42+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}
43+
golangci-lint --version
44+
45+
- name: Make
46+
run: make
47+
48+
- name: Make Image
49+
run: make image

.github/workflows/go-cross.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Go Matrix
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
8+
jobs:
9+
10+
cross:
11+
name: Go
12+
runs-on: ${{ matrix.os }}
13+
env:
14+
CGO_ENABLED: 0
15+
16+
strategy:
17+
matrix:
18+
go-version: [ stable, oldstable ]
19+
os: [ubuntu-latest, macos-latest, windows-latest]
20+
21+
steps:
22+
# https://github.com/marketplace/actions/checkout
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
# https://github.com/marketplace/actions/setup-go-environment
27+
- name: Set up Go ${{ matrix.go-version }}
28+
uses: actions/setup-go@v5
29+
with:
30+
go-version: ${{ matrix.go-version }}
31+
32+
- name: Test
33+
run: go test -v -cover ./...
34+
35+
- name: Build
36+
run: go build -v -ldflags "-s -w" -trimpath

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: "Release a tag"
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
7+
jobs:
8+
release:
9+
name: Release Process
10+
runs-on: ubuntu-latest
11+
env:
12+
GO_VERSION: stable
13+
CGO_ENABLED: 0
14+
15+
steps:
16+
17+
# https://github.com/marketplace/actions/checkout
18+
- name: Check out code
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
# https://github.com/marketplace/actions/setup-go-environment
24+
- name: Set up Go ${{ env.GO_VERSION }}
25+
uses: actions/setup-go@v5
26+
with:
27+
go-version: ${{ env.GO_VERSION }}
28+
29+
- name: dockerhub-login
30+
uses: docker/login-action@v3
31+
with:
32+
username: ${{ secrets.DOCKER_USERNAME }}
33+
password: ${{ secrets.DOCKER_PASSWORD }}
34+
35+
- name: ghcr-login
36+
uses: docker/login-action@v3
37+
with:
38+
registry: ghcr.io
39+
username: traefiker
40+
password: ${{ secrets.GHCR_TOKEN }}
41+
42+
- name: Set up QEMU
43+
uses: docker/setup-qemu-action@v3
44+
45+
- name: Set up Docker Buildx
46+
uses: docker/setup-buildx-action@v3
47+
48+
# https://goreleaser.com/ci/actions/
49+
- name: Run GoReleaser
50+
uses: goreleaser/goreleaser-action@v5
51+
with:
52+
version: latest
53+
args: release --clean
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_REPO }}

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.PHONY: default check test build image
2+
3+
IMAGE_NAME := traefik/whoamimcp
4+
5+
default: check test build
6+
7+
build:
8+
CGO_ENABLED=0 go build -a --trimpath --installsuffix cgo --ldflags="-s" -o whoamimcp
9+
10+
test:
11+
go test -v -cover ./...
12+
13+
check:
14+
golangci-lint run
15+
16+
image:
17+
docker build -t $(IMAGE_NAME) .
18+
19+
protoc:
20+
protoc --proto_path . ./grpc.proto --go-grpc_out=./ --go_out=./

buildx.Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# syntax=docker/dockerfile:1.2
2+
FROM golang:1-alpine as builder
3+
4+
RUN apk --no-cache --no-progress add git ca-certificates tzdata make \
5+
&& update-ca-certificates \
6+
&& rm -rf /var/cache/apk/*
7+
8+
# syntax=docker/dockerfile:1.2
9+
# Create a minimal container to run a Golang static binary
10+
FROM scratch
11+
12+
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
13+
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
14+
COPY whoamimcp /
15+
16+
ENTRYPOINT ["/whoamimcp"]
17+
EXPOSE 80

go.mod

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module github.com/traefik/whoamimcp
2+
3+
go 1.24.6
4+
5+
require github.com/modelcontextprotocol/go-sdk v0.4.0
6+
7+
require (
8+
github.com/google/jsonschema-go v0.2.1-0.20250825175020-748c325cec76 // indirect
9+
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
10+
)

go.sum

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
2+
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
3+
github.com/google/jsonschema-go v0.2.1-0.20250825175020-748c325cec76 h1:mBlBwtDebdDYr+zdop8N62a44g+Nbv7o2KjWyS1deR4=
4+
github.com/google/jsonschema-go v0.2.1-0.20250825175020-748c325cec76/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE=
5+
github.com/modelcontextprotocol/go-sdk v0.4.0 h1:RJ6kFlneHqzTKPzlQqiunrz9nbudSZcYLmLHLsokfoU=
6+
github.com/modelcontextprotocol/go-sdk v0.4.0/go.mod h1:whv0wHnsTphwq7CTiKYHkLtwLC06WMoY2KpO+RB9yXQ=
7+
github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4=
8+
github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4=
9+
golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo=
10+
golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg=

0 commit comments

Comments
 (0)