샘플
github.com/mholt/acmez/v3 v3.1.2: acme.StatusValid
검증된 샘플 — golang github.com/mholt/acmez/v3 v3.1.2: acme.StatusValid. go 1.26 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다.
sha256:36b49c2598e25c89f2471dfe725659fc153ab39d4a0acb41f9a26360ab0f8cfa
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
go linux 24 · ubuntu · glibc 2.39 x64 go go go
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| go 1.26 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · golang@1golang:1.26-alpine@sha256:28d89ee9cc0f… |
2026-08-28 |
케이스
HOW- 목표
- verify github.com/mholt/acmez/v3/acme.StatusValid in pkg:golang/github.com/mholt/acmez/v3@v3.1.2
- 심벌
-
- github.com/mholt/acmez/v3/acme.StatusValid
- 환경
- go
- 생성일
- 2026-08-28T01:46:01Z
컨트랙트
- acme.StatusValid is equal to the string constant "valid".
- acme.Account preserves Status equal to acme.StatusValid across JSON serialization and deserialization.
- acme.Order in state acme.StatusValid retains valid authorizations, expiration, and certificate URL.
- acme.Authorization with Status equal to acme.StatusValid contains valid challenges and expiration.
- acme.Challenge with Status equal to acme.StatusValid computes correct HTTP-01 challenge resource path.
파일
- PROMPT.md
- csx.json
- go.mod
- go.sum
- main.go
- spec.json
- test/contract_test.go
소스
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify github.com/mholt/acmez/v3/acme.StatusValid in pkg:golang/github.com/mholt/acmez/v3@v3.1.2
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:golang/github.com/mholt/acmez/v3@v3.1.2
Demonstrate these symbols/APIs:
- github.com/mholt/acmez/v3/acme.StatusValid
Constraints:
- executionContext: node
Required runtime conditions:
- ecosystem: npm
- language: javascript
- moduleSystem: cjs
- packageManager: npm@10.9.8
- runtime: node@22.23.2
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:9f9fd9128c7791ded93b6cbe89b1fb3f632f5aaf7e4a54a8c33ea06bc975499a","contract":["acme.StatusValid is equal to the string constant \"valid\".","acme.Account preserves Status equal to acme.StatusValid across JSON serialization and deserialization.","acme.Order in state acme.StatusValid retains valid authorizations, expiration, and certificate URL.","acme.Authorization with Status equal to acme.StatusValid contains valid challenges and expiration.","acme.Challenge with Status equal to acme.StatusValid computes correct HTTP-01 challenge resource path."],"goal":"verify github.com/mholt/acmez/v3/acme.StatusValid in pkg:golang/github.com/mholt/acmez/v3@v3.1.2","kind":"HOW","packages":["pkg:golang/github.com/mholt/acmez/v3@v3.1.2"],"schemaVersion":1,"symbols":["github.com/mholt/acmez/v3/acme.StatusValid"]},"contractCommand":["go","test","./..."],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"golang","executionContext":"go","language":"go","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"go","runtime":"go","schemaVersion":1},"license":"MIT-0","packages":["pkg:golang/github.com/mholt/acmez/v3@v3.1.2"],"schemaVersion":1,"subject":"pkg:golang/github.com/mholt/acmez/v3@v3.1.2","symbols":["github.com/mholt/acmez/v3/acme.StatusValid"],"verifierAdapter":"golang@1"}
module example.com/acmevalid
go 1.26.6
require (
github.com/mholt/acmez/v3 v3.1.2
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/text v0.18.0 // indirect
)
github.com/mholt/acmez/v3 v3.1.2 h1:auob8J/0FhmdClQicvJvuDavgd5ezwLBfKuYmynhYzc=
github.com/mholt/acmez/v3 v3.1.2/go.mod h1:L1wOU06KKvq7tswuMDwKdcHeKpFFgkppZy/y0DFxagQ=
golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
package main
import (
"encoding/json"
"fmt"
"time"
"github.com/mholt/acmez/v3/acme"
)
func main() {
now := time.Now().UTC().Truncate(time.Second)
account := acme.Account{
Status: acme.StatusValid,
Contact: []string{"mailto:admin@example.com"},
Orders: "https://example.com/acme/acct/1/orders",
}
order := acme.Order{
Status: acme.StatusValid,
Expires: now.Add(24 * time.Hour),
Identifiers: []acme.Identifier{{Type: "dns", Value: "example.com"}},
Authorizations: []string{"https://example.com/acme/authz/1"},
Finalize: "https://example.com/acme/order/1/finalize",
Certificate: "https://example.com/acme/cert/1",
}
authz := acme.Authorization{
Identifier: acme.Identifier{Type: "dns", Value: "example.com"},
Status: acme.StatusValid,
Expires: now.Add(24 * time.Hour),
Challenges: []acme.Challenge{
{
Type: "http-01",
URL: "https://example.com/acme/chall/1",
Status: acme.StatusValid,
Validated: "2026-08-28T00:00:00Z",
Token: "test-token",
},
},
}
accJSON, _ := json.Marshal(account)
orderJSON, _ := json.Marshal(order)
authzJSON, _ := json.Marshal(authz)
fmt.Printf("ACME StatusValid constant: %s\n", acme.StatusValid)
fmt.Printf("Account JSON: %s\n", string(accJSON))
fmt.Printf("Order JSON: %s\n", string(orderJSON))
fmt.Printf("Authz JSON: %s\n", string(authzJSON))
}
{
"schemaVersion": 1,
"goal": "verify github.com/mholt/acmez/v3/acme.StatusValid in pkg:golang/github.com/mholt/acmez/v3@v3.1.2",
"kind": "HOW",
"packages": [
"pkg:golang/github.com/mholt/acmez/v3@v3.1.2"
],
"symbols": [
"github.com/mholt/acmez/v3/acme.StatusValid"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@10.9.8",
"runtime": "node@22.23.2"
}
}
package test
import (
"encoding/json"
"testing"
"time"
"github.com/mholt/acmez/v3/acme"
)
func TestStatusValidConstant(t *testing.T) {
if acme.StatusValid != "valid" {
t.Fatalf("acme.StatusValid = %q, want 'valid'", acme.StatusValid)
}
}
func TestAccountStatusValid(t *testing.T) {
acc := acme.Account{
Status: acme.StatusValid,
Contact: []string{"mailto:admin@example.com"},
Orders: "https://example.com/acme/acct/1/orders",
}
data, err := json.Marshal(acc)
if err != nil {
t.Fatalf("json.Marshal failed: %v", err)
}
var parsed acme.Account
if err := json.Unmarshal(data, &parsed); err != nil {
t.Fatalf("json.Unmarshal failed: %v", err)
}
if parsed.Status != acme.StatusValid {
t.Errorf("parsed.Status = %q, want %q", parsed.Status, acme.StatusValid)
}
}
func TestOrderStatusValid(t *testing.T) {
now := time.Now().UTC().Truncate(time.Second)
order := acme.Order{
Status: acme.StatusValid,
Expires: now.Add(24 * time.Hour),
Identifiers: []acme.Identifier{{Type: "dns", Value: "example.com"}},
Authorizations: []string{"https://example.com/acme/authz/1"},
Finalize: "https://example.com/acme/order/1/finalize",
Certificate: "https://example.com/acme/cert/1",
}
data, err := json.Marshal(order)
if err != nil {
t.Fatalf("json.Marshal failed: %v", err)
}
var parsed acme.Order
if err := json.Unmarshal(data, &parsed); err != nil {
t.Fatalf("json.Unmarshal failed: %v", err)
}
if parsed.Status != acme.StatusValid {
t.Errorf("parsed.Status = %q, want %q", parsed.Status, acme.StatusValid)
}
if parsed.Certificate != "https://example.com/acme/cert/1" {
t.Errorf("parsed.Certificate = %q, want https://example.com/acme/cert/1", parsed.Certificate)
}
}
func TestAuthorizationStatusValid(t *testing.T) {
exp := time.Now().Add(24 * time.Hour).UTC().Truncate(time.Second)
authz := acme.Authorization{
Identifier: acme.Identifier{Type: "dns", Value: "example.com"},
Status: acme.StatusValid,
Expires: exp,
Challenges: []acme.Challenge{
{
Type: "http-01",
URL: "https://example.com/acme/chall/1",
Status: acme.StatusValid,
Validated: "2026-08-28T00:00:00Z",
Token: "testToken123",
},
},
}
data, err := json.Marshal(authz)
if err != nil {
t.Fatalf("json.Marshal failed: %v", err)
}
var parsed acme.Authorization
if err := json.Unmarshal(data, &parsed); err != nil {
t.Fatalf("json.Unmarshal failed: %v", err)
}
if parsed.Status != acme.StatusValid {
t.Errorf("parsed.Status = %q, want %q", parsed.Status, acme.StatusValid)
}
if len(parsed.Challenges) != 1 || parsed.Challenges[0].Status != acme.StatusValid {
t.Errorf("parsed challenge status = %q, want %q", parsed.Challenges[0].Status, acme.StatusValid)
}
if parsed.IdentifierValue() != "example.com" {
t.Errorf("parsed.IdentifierValue() = %q, want example.com", parsed.IdentifierValue())
}
}
func TestChallengeStatusValid(t *testing.T) {
chall := acme.Challenge{
Type: "http-01",
URL: "https://example.com/acme/chall/1",
Status: acme.StatusValid,
Validated: "2026-08-28T00:00:00Z",
Token: "token-abc",
}
if chall.Status != acme.StatusValid {
t.Errorf("chall.Status = %q, want %q", chall.Status, acme.StatusValid)
}
if chall.HTTP01ResourcePath() != "/.well-known/acme-challenge/token-abc" {
t.Errorf("chall.HTTP01ResourcePath() = %q, want /.well-known/acme-challenge/token-abc", chall.HTTP01ResourcePath())
}
}
오리진 시더
익명