본문으로 건너뛰기
cccskills
무료GitHub에 공개한국어 소개

authz-configurator

SigNoz 백엔드 기능과 API 경로에 권한 부여를 처음부터 설정합니다. 리소스 등록, 관리 역할별 권한 지정, 기존 조직을 위한 마이그레이션과 역할별 허용·거부 통합 테스트를 안내합니다.

원문원문 설명 보기

Add authorization (authz) to a SigNoz backend feature end-to-end — register kinds/resources, grant managed-role permissions, wire routes with ResourceDefs, backfill tuples for existing orgs, and write the authz integration tests. Use this whenever the user mentions authz, authorization, permissions, access control, managed roles (admin/editor/viewer), OpenFGA, ResourceDef, CheckResources, 403/forbidden behavior on an endpoint, wiring or protecting a new route, registering a new resource/kind, or writing integration tests that assert role-based allow/deny. Also use it when a new API endpoint is being added and its access control hasn't been decided yet — every route needs an authz decision even if the user didn't say the word.

SigNoz/signoz스타 32,475(GitHub 32,475 + cccskills 0)

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • 새 API 경로 보호하기
  • 리소스와 관리 역할 권한 등록하기
  • 기존 조직에 권한 반영하기
  • 역할별 접근 허용과 거부 테스트하기

한국어 소개

할 수 있는 일

이 스킬은 SigNoz 백엔드 기능에 권한 부여를 적용하는 과정을 리소스 등록부터 경로 설정과 테스트까지 안내합니다. 종류와 리소스를 등록하고 admin, editor, viewer 같은 관리 역할에 권한을 배정하며, 각 경로에서 대상 리소스와 작업을 지정하는 ResourceDef를 설정할 수 있습니다. 기존 조직에도 새 권한을 적용해야 한다면 관련 튜플과 역할 정보를 갱신하는 마이그레이션을 추가하도록 안내합니다. 통합 테스트로 역할별 허용과 거부를 확인하고, 필요한 경우 개별 리소스에 대한 접근도 검사할 수 있습니다.

이럴 때 유용합니다

새 API 경로를 추가하거나 기존 기능의 권한을 변경할 때 사용할 수 있습니다. SigNoz가 OpenFGA를 이용해 권한을 처리하는 방식을 파악하고, 리소스 등록이나 경로 설정을 빠뜨리지 않으려는 개발자에게도 유용합니다. 새 리소스를 추가하는지, 기존 리소스에 경로를 더하는지, 역할 권한을 바꾸는지, 테스트를 작성하는지에 따라 필요한 절차를 선택합니다.

사용 예시

  • “이 새 API 경로에 필요한 권한 설정과 역할 권한을 추가해 주세요.”
  • “viewer는 이 리소스를 읽기만 하고 editor는 수정할 수 있게 한 뒤 통합 테스트도 작성해 주세요.”
  • “기존 조직에도 새 관리 역할 권한을 적용하는 마이그레이션을 만들어 주세요.”

주의 사항

SigNoz 개발 절차와 참고 자료, 생성 명령, Go 및 Python 테스트 환경을 사용합니다. 기존 조직에도 새 권한을 적용해야 하는지 확인해야 합니다. 새로운 FGA 유형을 추가하려면 스키마를 편집해야 하므로 일반적인 종류 추가와는 다르게 다룹니다.

이 소개문은 공개된 SKILL.md를 바탕으로 AI(OpenAI Codex)가 작성했습니다. 정확한 사양은 아래 원문을 확인하세요.

문서 점검

AI가 SKILL.md의 내용에서 주의가 필요한 작업과 도입 전제를 확인했습니다. 점수는 실제로 실행한 결과(실행 검증)만으로 매깁니다.

안전성전송·삭제·명령 실행 등을 명시하고 있는가
B일부 부족기존 조직에 권한을 반영할지 확인하도록 하지만 일부 작업 영향 설명은 제한적입니다.
도입의 용이성필요한 도구나 API 키가 적고 적혀 있는가
B일부 부족SigNoz 참고 자료와 Go·Python 테스트 환경을 사용하지만 전체 설치 절차는 없습니다.

점수에는 넣지 않았습니다. 2026년 10월 28일 기준으로 AI(OpenAI Codex)가 판정했습니다. 참고용이므로 설치 전에 원문도 확인해 주세요.

평가가 다르다고 생각되면 재검토를 요청하기

어느 항목이 왜 다르다고 생각하는지 적어 주세요. 로그인은 필요 없습니다. SKILL.md와 대조해 평가를 다시 만들고 이곳에 반영합니다.

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

포함된 파일(3)

  • SKILL.md11.1 KB
  • references/integration-tests.md6.7 KB
  • references/route-wiring.md7.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

SigNoz Authz Workflow

This skill automates the procedure documented in docs/contributing/go/authz.md. Read that doc first — it is the canonical explanation of the concepts (types, verbs, kinds, resources, selectors, tuples, the community/enterprise split). This skill tells you what to do; the doc tells you why it works.

The core model in one paragraph: permissions are never attached to users. They are attached to roles as OpenFGA tuples, and users/service accounts are made assignees of roles. You declare everything in code registries under pkg/types/coretypes/; tuples for new organizations are derived from those registries at org bootstrap. Routes declare what resource+verb they touch via ResourceDefs, and middleware turns that into a check that works in both community (role gate) and enterprise (per-resource FGA) editions.

Before you start

Figure out what shape the work is. Ask the user if unclear:

  • New resource (new kind + routes) → all steps below.
  • New route on an existing resource → step 4 only (maybe step 3 if roles need new verbs).
  • Changing what a role can do → steps 3, 5, 6, 7.
  • Just tests → steps 6, 7.

Almost every feature resource is a metaresource (dashboards, rules, pipelines) or a telemetryresource (logs, traces, metrics). If the feature genuinely needs a brand-new FGA type, stop and flag it to the user — that requires editing both pkg/authz/openfgaschema/base.fga and ee/authz/openfgaschema/base.fga together and is almost never the right call. A new kind never touches the schema.

Step 1: Register the kind

Edit pkg/types/coretypes/registry_kind.go. Add a var and append it to the Kinds slice (both are required — the slice is what gets validated and iterated):

KindThing = MustNewKind("thing")

Kind names are lowercase, hyphen-separated (quick-filter, trace-funnel, notification-channel).

Also add the kind to Kind.Enum() in pkg/types/coretypes/kind.go — a second hand-maintained list mirroring Kinds that feeds the OpenAPI enum. It is easy to miss because nothing fails at build time without it; the drift only shows up in the generated spec.

Step 2: Register the resource

Edit pkg/types/coretypes/registry_resource.go. Add a var and append it to the Resources slice:

ResourceMetaResourceThing = NewResourceMetaResource(KindThing)

Use NewResourceTelemetryResource(KindThing) for telemetry data resources. Pass an explicit verb list only when the resource supports fewer verbs than the type default — see ResourceMetaResourceFactorAPIKey in that file for the shape.

Step 3: Grant permissions to managed roles

Edit pkg/types/coretypes/registry_managed_role.go. Add Transaction entries to ManagedRoleToTransactions for each role that may act on the resource:

{Verb: VerbCreate, Object: *MustNewObject(ResourceRef{Type: TypeMetaResource, Kind: KindThing}, WildCardSelectorString)},

The convention: admin gets everything; editor gets full CRUD only on day-to-day observability resources (dashboards, rules, saved views — not access control or org settings); viewer gets read/list; anonymous gets nothing (public dashboards are the only exception). Match the file's existing style, including its one-line grouping comment per resource block (e.g. // thing — editors manage, viewers read) — that file uses grouping comments as structure; do not add comments anywhere else.

This map is the single source of truth: changing it affects only organizations created afterwards (see step 5 for existing orgs), and the integration suite asserts its contents via a golden file (see step 6).

Step 4: Wire the route

Register routes in the existing domain file under pkg/apiserver/signozapiserver/ — do not create new per-sub-resource route files. Each route needs three coordinated pieces:

  1. provider.authzMiddleware.CheckResources(handlerFn, roles...) — the role list is the community-edition fallback gate (which managed roles may call this route when per-resource checks are unavailable).
  2. handler.WithResourceDefs(...) — declares resource, verb, audit category, ID extractor, and selector.
  3. SecuritySchemes: newScopedSecuritySchemes([]string{resource.Scope(verb)}) — advertises the scope in the OpenAPI spec.

Selector rules (getting these wrong silently over- or under-authorizes):

OperationSelectorID extractor
createWildcardSelectorResponseJSONPath("data.id") (ID exists only after the handler runs; recorded for audit)
listWildcardSelectornone
read/update/delete of one instanceIDSelectorPathParam("id") or BodyJSONPath(...)
request ID ≠ FGA selector (e.g. route has a role UUID, FGA objects use role names)custom SelectorFuncas appropriate

Routes that link two resources check both sides. Read references/route-wiring.md before wiring any create route, linking route (attach/detach, parent-child), or custom selector — it has complete real examples from serviceaccount.go.

Prefer CheckResources + ResourceDef for anything resource-shaped. The legacy gates ViewAccess/EditAccess/AdminAccess are coarse role-only checks — do not use them for new routes. OpenAccess means no authorization (authentication still applies); CheckWithoutClaims serves anonymous routes.

Step 5: Backfill existing organizations (only if needed)

New organizations derive their tuples from the registries at creation — no migration needed for them. If existing organizations must get the new permissions, add a migration in pkg/sqlmigration/ that does two things per org:

  1. Insert the FGA tuples — follow 083_add_role_crud_tuples.go: one tuple row (+ changelog row) per role/verb/object, with ON CONFLICT ... DO NOTHING so it stays idempotent, handling both the Postgres and SQLite tuple column layouts as that file does.
  2. Refresh the managed roles' JSON record — since 099_add_role_transaction_groups.go, each role row carries a transaction_groups JSON column that mirrors its permissions. Tuples and JSON must move together or the stored record drifts from the registry. Follow 099's managed-role loop: marshal authtypes.NewTransactionGroupsFromTransactions(coretypes.ManagedRoleToTransactions[roleName]) and UPDATE role SET transaction_groups = ? WHERE org_id = ? AND type = 'managed' AND name = ?. Serializing from the registry (which already contains your new grants) makes this step self-updating. Custom roles need no changes — only managed roles mirror the registry.

Register the new migration factory in NewSQLMigrationProviderFactories in pkg/signoz/provider.go, appended after the existing entries. The factory name passed to factory.MustNewName must match ^[a-z][a-z0-9_-]{0,30}$ — at most 31 characters, or it panics at startup; prefer a short name like notification_template_tuples over add_notification_template_tuples.

Ask the user whether backfill is needed rather than assuming — shipping a feature to existing orgs almost always means yes.

Step 6: Update the golden testdata and regenerate CI-checked artifacts

If you changed ManagedRoleToTransactions, update tests/integration/testdata/role/managed_role_transactions.json to match — the role/01_register.py integration test compares each managed role's verb/type/kind matrix against this file and will fail otherwise.

If you touched the registries or Kind.Enum(), regenerate the derived artifacts. The goci GitHub workflow reruns each of these and fails the PR on any uncommitted diff:

go run cmd/enterprise/*.go generate openapi                    # docs/api/openapi.yml
go run cmd/enterprise/*.go generate authz                      # frontend/src/lib/authz/hooks/useAuthZ/permissions.type.ts
go run cmd/enterprise/*.go generate config transaction-groups  # frontend/src/schemas/generated/transactionGroups.schema.json

Commit whatever they change; never hand-edit these generated files.

generate authz is allowlist-based: it only emits resources listed in the allowedResources map inside runGenerateAuthz in cmd/authz.go. For the new resource to surface in the UI's permission gating (AuthZButton and friends), add it there —

coretypes.NewResourceRef(coretypes.ResourceMetaResourceThing).String(): true,

— then rerun generate authz and commit the regenerated permissions.type.ts. If the resource has no UI surface yet, skip the allowlist entry and the command produces no diff; that is expected.

Step 7: Write integration tests

Read references/integration-tests.md for the suite layout, fixtures, and canonical allow/deny test shapes. The minimum bar for a new authz'd resource: each managed role's expected 200-vs-403 matrix on the new routes, and (if enterprise/FGA behavior matters) per-object scoping with a custom role — granted instance succeeds, non-granted instance gets 403, revoke flips it back to 403.

Python test conventions that are hard rules in this repo: inline requests.* calls directly (never wrap single API calls in helpers), always pass timeout=, and run make py-fmt && make py-lint before finishing.

Verification

Run these before declaring the work done:

make go-build-community

Consistency greps — every one of these must hold:

  • the new Kind var appears in BOTH the Kinds slice (registry_kind.go) and Kind.Enum() (kind.go)
  • the three generate commands from step 6 have been run and leave git diff clean when re-run
  • if the resource is UI-gated, it appears in allowedResources in cmd/authz.go and permissions.type.ts was regenerated
  • the new Resource var appears in the Resources slice (registry_resource.go)
  • every ResourceDef in the route file references the registered resource and one of its allowed verbs
  • every route's SecuritySchemes scope matches its ResourceDef verb
  • if ManagedRoleToTransactions changed, managed_role_transactions.json changed with it

Then run the relevant integration suites (make py-test-setup from the repo root boots the environment; pytest runs from tests/):

uv run pytest --basetemp=./tmp/ -vv --reuse integration/tests/role/
uv run pytest --basetemp=./tmp/ -vv --reuse integration/tests/<your-suite>/

General repo conventions apply throughout: no code comments (the grouping comments in registry_managed_role.go are the sole exception), complete descriptive names, and never commit without an explicit ask.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

migrate-state-management

무료요약 있음

Redux나 React Context에 모인 상태를 용도별로 나누어 React Query, nuqs, Zustand 또는 컴포넌트 로컬 상태로 옮깁니다. API 데이터, URL 공유 조건, 화면 상태를 정리할 수 있습니다.

  • Redux 또는 React Context에서 이전
  • API 데이터의 중복 저장 해소
  • URL로 필터와 페이지 번호 공유
SigNoz/signoz3.2만2026년 10월 30일 업데이트

sbshot-visual-diff

무료요약 있음

코드 변경 전후의 Storybook 화면을 어두운 테마와 밝은 테마에서 비교합니다. 촬영 흔들림을 확인하고 주요 차이에 주석을 달아 검토자가 볼 수 있는 정적 페이지로 내보냅니다.

  • 변경 전후 화면 비교
  • 어두운 테마와 밝은 테마 확인
  • PR에 주석이 있는 화면 차이 공유
SigNoz/signoz3.2만2026년 10월 30일 업데이트

scaffold-feature

무료요약 있음

명령으로 페이지와 컴포넌트의 폴더 및 파일 틀을 생성하고 기능별로 관련 파일을 모읍니다. 탭 화면 틀과 테스트, README를 만들고 제공된 프런트엔드 구조에 페이지 경로를 등록할 수 있습니다.

  • 일관된 폴더 구조로 새 페이지 시작하기
  • 여러 탭이 있는 페이지 틀 만들기
  • 기능 폴더에 컴포넌트 추가하기
SigNoz/signoz3.2만2026년 10월 30일 업데이트

signoz-page-story

무료요약 있음

SigNoz 페이지의 API 요청, 표시 상태, URL 매개변수를 정리해 Storybook 스토리를 만듭니다. `msw`로 응답을 모의하고 조작 패널에서 로딩, 오류, 권한별 상태를 확인할 수 있습니다.

  • SigNoz 페이지 Storybook 스토리 만들기
  • 로딩, 빈 화면, 오류 상태 확인하기
  • 권한별 버튼 동작 확인하기
SigNoz/signoz3.2만2026년 10월 30일 업데이트

SigNoz의 스킬 모두 보기

이 스킬의 문제 신고