@paths.design/caws-cli 7.0.1 → 7.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/budget-derivation.js +5 -4
- package/dist/commands/diagnose.js +26 -20
- package/dist/commands/init.js +72 -5
- package/dist/commands/specs.js +40 -1
- package/dist/commands/status.js +2 -2
- package/dist/commands/templates.js +10 -0
- package/dist/commands/tool.js +2 -3
- package/dist/commands/validate.js +12 -0
- package/dist/config/index.js +17 -8
- package/dist/generators/working-spec.js +42 -9
- package/dist/index.js +3 -1
- package/dist/scaffold/cursor-hooks.js +10 -2
- package/dist/scaffold/git-hooks.js +189 -32
- package/dist/scaffold/index.js +105 -17
- package/dist/templates/.caws/tools/README.md +20 -0
- package/dist/templates/.cursor/README.md +311 -0
- package/dist/templates/.cursor/hooks/audit.sh +55 -0
- package/dist/templates/.cursor/hooks/block-dangerous.sh +83 -0
- package/dist/templates/.cursor/hooks/caws-quality-check.sh +52 -0
- package/dist/templates/.cursor/hooks/caws-scope-guard.sh +130 -0
- package/dist/templates/.cursor/hooks/caws-tool-validation.sh +121 -0
- package/dist/templates/.cursor/hooks/format.sh +38 -0
- package/dist/templates/.cursor/hooks/naming-check.sh +64 -0
- package/dist/templates/.cursor/hooks/scan-secrets.sh +46 -0
- package/dist/templates/.cursor/hooks/scope-guard.sh +52 -0
- package/dist/templates/.cursor/hooks/validate-spec.sh +83 -0
- package/dist/templates/.cursor/hooks.json +59 -0
- package/dist/templates/.cursor/rules/00-claims-verification.mdc +144 -0
- package/dist/templates/.cursor/rules/01-working-style.mdc +50 -0
- package/dist/templates/.cursor/rules/02-quality-gates.mdc +370 -0
- package/dist/templates/.cursor/rules/03-naming-and-refactor.mdc +33 -0
- package/dist/templates/.cursor/rules/04-logging-language-style.mdc +23 -0
- package/dist/templates/.cursor/rules/05-safe-defaults-guards.mdc +23 -0
- package/dist/templates/.cursor/rules/06-typescript-conventions.mdc +36 -0
- package/dist/templates/.cursor/rules/07-process-ops.mdc +20 -0
- package/dist/templates/.cursor/rules/08-solid-and-architecture.mdc +16 -0
- package/dist/templates/.cursor/rules/09-docstrings.mdc +89 -0
- package/dist/templates/.cursor/rules/10-documentation-quality-standards.mdc +390 -0
- package/dist/templates/.cursor/rules/11-scope-management-waivers.mdc +385 -0
- package/dist/templates/.cursor/rules/12-implementation-completeness.mdc +516 -0
- package/dist/templates/.cursor/rules/13-language-agnostic-standards.mdc +588 -0
- package/dist/templates/.cursor/rules/README.md +148 -0
- package/dist/templates/.github/copilot/instructions.md +311 -0
- package/dist/templates/.idea/runConfigurations/CAWS_Evaluate.xml +5 -0
- package/dist/templates/.idea/runConfigurations/CAWS_Validate.xml +5 -0
- package/dist/templates/.vscode/launch.json +56 -0
- package/dist/templates/.vscode/settings.json +93 -0
- package/dist/templates/.windsurf/workflows/caws-guided-development.md +92 -0
- package/dist/templates/COMMIT_CONVENTIONS.md +86 -0
- package/dist/templates/OIDC_SETUP.md +300 -0
- package/dist/templates/agents.md +1047 -0
- package/dist/templates/codemod/README.md +1 -0
- package/dist/templates/codemod/test.js +93 -0
- package/dist/templates/docs/README.md +150 -0
- package/dist/templates/scripts/quality-gates/check-god-objects.js +146 -0
- package/dist/templates/scripts/quality-gates/run-quality-gates.js +50 -0
- package/dist/templates/scripts/v3/analysis/todo_analyzer.py +1997 -0
- package/dist/tool-loader.js +6 -1
- package/dist/tool-validator.js +8 -2
- package/dist/utils/detection.js +34 -6
- package/dist/utils/git-lock.js +118 -0
- package/dist/utils/gitignore-updater.js +148 -0
- package/dist/utils/quality-gates.js +47 -7
- package/dist/utils/spec-resolver.js +23 -3
- package/dist/utils/yaml-validation.js +155 -0
- package/dist/validation/spec-validation.js +105 -2
- package/package.json +2 -2
- package/templates/.caws/schemas/waivers.schema.json +30 -0
- package/templates/.caws/schemas/working-spec.schema.json +133 -0
- package/templates/.caws/templates/working-spec.template.yml +74 -0
- package/templates/.caws/tools/README.md +20 -0
- package/templates/.caws/tools/scope-guard.js +208 -0
- package/templates/.caws/tools-allow.json +331 -0
- package/templates/.caws/waivers.yml +19 -0
- package/templates/.cursor/hooks/scope-guard.sh +2 -2
- package/templates/.cursor/hooks/validate-spec.sh +42 -7
- package/templates/apps/tools/caws/COMPLETION_REPORT.md +0 -331
- package/templates/apps/tools/caws/MIGRATION_SUMMARY.md +0 -360
- package/templates/apps/tools/caws/README.md +0 -463
- package/templates/apps/tools/caws/TEST_STATUS.md +0 -365
- package/templates/apps/tools/caws/attest.js +0 -357
- package/templates/apps/tools/caws/ci-optimizer.js +0 -642
- package/templates/apps/tools/caws/config.ts +0 -245
- package/templates/apps/tools/caws/cross-functional.js +0 -876
- package/templates/apps/tools/caws/dashboard.js +0 -1112
- package/templates/apps/tools/caws/flake-detector.ts +0 -362
- package/templates/apps/tools/caws/gates.js +0 -198
- package/templates/apps/tools/caws/gates.ts +0 -271
- package/templates/apps/tools/caws/language-adapters.ts +0 -381
- package/templates/apps/tools/caws/language-support.d.ts +0 -367
- package/templates/apps/tools/caws/language-support.d.ts.map +0 -1
- package/templates/apps/tools/caws/language-support.js +0 -585
- package/templates/apps/tools/caws/legacy-assessment.ts +0 -408
- package/templates/apps/tools/caws/legacy-assessor.js +0 -764
- package/templates/apps/tools/caws/mutant-analyzer.js +0 -734
- package/templates/apps/tools/caws/perf-budgets.ts +0 -349
- package/templates/apps/tools/caws/prompt-lint.js.backup +0 -274
- package/templates/apps/tools/caws/property-testing.js +0 -707
- package/templates/apps/tools/caws/provenance.d.ts +0 -14
- package/templates/apps/tools/caws/provenance.d.ts.map +0 -1
- package/templates/apps/tools/caws/provenance.js +0 -132
- package/templates/apps/tools/caws/provenance.js.backup +0 -73
- package/templates/apps/tools/caws/provenance.ts +0 -211
- package/templates/apps/tools/caws/security-provenance.ts +0 -483
- package/templates/apps/tools/caws/shared/base-tool.ts +0 -281
- package/templates/apps/tools/caws/shared/config-manager.ts +0 -366
- package/templates/apps/tools/caws/shared/gate-checker.ts +0 -849
- package/templates/apps/tools/caws/shared/types.ts +0 -444
- package/templates/apps/tools/caws/shared/validator.ts +0 -305
- package/templates/apps/tools/caws/shared/waivers-manager.ts +0 -174
- package/templates/apps/tools/caws/spec-test-mapper.ts +0 -391
- package/templates/apps/tools/caws/test-quality.js +0 -578
- package/templates/apps/tools/caws/validate.js +0 -76
- package/templates/apps/tools/caws/validate.ts +0 -228
- package/templates/apps/tools/caws/waivers.js +0 -344
- /package/{templates/apps/tools/caws → dist/templates/.caws}/schemas/waivers.schema.json +0 -0
- /package/{templates/apps/tools/caws → dist/templates/.caws}/schemas/working-spec.schema.json +0 -0
- /package/{templates/apps/tools/caws → dist/templates/.caws}/templates/working-spec.template.yml +0 -0
- /package/{templates/apps/tools/caws → dist/templates/.caws/tools}/scope-guard.js +0 -0
- /package/{templates/apps/tools/caws → dist/templates/.caws}/tools-allow.json +0 -0
- /package/{templates/apps/tools/caws → dist/templates/.caws}/waivers.yml +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# /caws-guided-development
|
|
2
|
+
|
|
3
|
+
## CAWS-Guided Feature Development Workflow
|
|
4
|
+
|
|
5
|
+
**Purpose**: Guide agents through feature development with CAWS quality assurance
|
|
6
|
+
|
|
7
|
+
**Tags**: development, quality, caws, feature
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
### 1. Initialize CAWS Working Spec
|
|
12
|
+
```
|
|
13
|
+
# Create comprehensive working specification
|
|
14
|
+
caws init feature-name --interactive
|
|
15
|
+
|
|
16
|
+
# Define acceptance criteria, scope, and risk assessment
|
|
17
|
+
# Working spec: .caws/working-spec.yaml
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### 2. Plan Implementation Strategy
|
|
21
|
+
```
|
|
22
|
+
# Get CAWS guidance for implementation approach
|
|
23
|
+
caws agent iterate --current-state "Planning phase complete, need implementation strategy"
|
|
24
|
+
|
|
25
|
+
# CAWS will suggest:
|
|
26
|
+
# - Implementation steps
|
|
27
|
+
# - Quality gates to consider
|
|
28
|
+
# - Risk mitigation strategies
|
|
29
|
+
# - Testing approach
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 3. Implement Core Functionality
|
|
33
|
+
```
|
|
34
|
+
# Start coding with CAWS quality monitoring
|
|
35
|
+
# Real-time feedback via CAWS tools
|
|
36
|
+
|
|
37
|
+
# Regular quality checks
|
|
38
|
+
caws agent evaluate --quiet
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 4. Quality Assurance Integration
|
|
42
|
+
```
|
|
43
|
+
# Run comprehensive quality gates
|
|
44
|
+
caws validate
|
|
45
|
+
|
|
46
|
+
# Address any failing gates
|
|
47
|
+
# Create waivers if justified
|
|
48
|
+
caws waivers create --reason emergency_hotfix --gates coverage_threshold
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 5. Testing & Validation
|
|
52
|
+
```
|
|
53
|
+
# Unit tests
|
|
54
|
+
npm run test:unit
|
|
55
|
+
|
|
56
|
+
# Integration tests
|
|
57
|
+
npm run test:integration
|
|
58
|
+
|
|
59
|
+
# Contract tests
|
|
60
|
+
npm run test:contract
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### 6. Final Quality Review
|
|
64
|
+
```
|
|
65
|
+
# Complete CAWS evaluation
|
|
66
|
+
caws agent evaluate
|
|
67
|
+
|
|
68
|
+
# Generate provenance report
|
|
69
|
+
caws provenance generate
|
|
70
|
+
|
|
71
|
+
# Ready for integration
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
**Quality Gates**:
|
|
77
|
+
- ✅ Working spec validation
|
|
78
|
+
- ✅ Code quality standards
|
|
79
|
+
- ✅ Test coverage requirements
|
|
80
|
+
- ✅ Security scanning
|
|
81
|
+
- ✅ Performance budgets
|
|
82
|
+
|
|
83
|
+
**Success Criteria**:
|
|
84
|
+
- All CAWS quality gates pass
|
|
85
|
+
- Acceptance criteria met
|
|
86
|
+
- No critical security issues
|
|
87
|
+
- Performance requirements satisfied
|
|
88
|
+
|
|
89
|
+
**Call Other Workflows**:
|
|
90
|
+
- `/caws-testing-workflow` - Comprehensive testing
|
|
91
|
+
- `/caws-security-review` - Security validation
|
|
92
|
+
- `/caws-deployment-checklist` - Deployment preparation
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Commit Message Conventions
|
|
2
|
+
|
|
3
|
+
This repository uses [Conventional Commits](https://conventionalcommits.org/) for automated versioning and changelog generation.
|
|
4
|
+
|
|
5
|
+
## Format
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
<type>[optional scope]: <description>
|
|
9
|
+
|
|
10
|
+
[optional body]
|
|
11
|
+
|
|
12
|
+
[optional footer(s)]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Types
|
|
16
|
+
|
|
17
|
+
- **feat**: A new feature
|
|
18
|
+
- **fix**: A bug fix
|
|
19
|
+
- **docs**: Documentation only changes
|
|
20
|
+
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
|
|
21
|
+
- **refactor**: A code change that neither fixes a bug nor adds a feature
|
|
22
|
+
- **perf**: A code change that improves performance
|
|
23
|
+
- **test**: Adding missing tests or correcting existing tests
|
|
24
|
+
- **build**: Changes that affect the build system or external dependencies
|
|
25
|
+
- **ci**: Changes to our CI configuration files and scripts
|
|
26
|
+
- **chore**: Other changes that don't modify src or test files
|
|
27
|
+
|
|
28
|
+
## Examples
|
|
29
|
+
|
|
30
|
+
### Feature
|
|
31
|
+
```
|
|
32
|
+
feat: add user authentication system
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Bug Fix
|
|
36
|
+
```
|
|
37
|
+
fix: resolve memory leak in data processing
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Documentation
|
|
41
|
+
```
|
|
42
|
+
docs: update API documentation for new endpoints
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Refactoring
|
|
46
|
+
```
|
|
47
|
+
refactor: extract user validation logic into separate module
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Breaking Change
|
|
51
|
+
```
|
|
52
|
+
feat!: change API response format for user data
|
|
53
|
+
|
|
54
|
+
BREAKING CHANGE: The user object now returns additional fields and the format has changed
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Scope
|
|
58
|
+
|
|
59
|
+
The scope should be the name of the package or module affected by the change:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
feat(auth): add OAuth2 authentication
|
|
63
|
+
fix(api): resolve endpoint timeout issue
|
|
64
|
+
docs(cli): update installation instructions
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Automated Publishing
|
|
68
|
+
|
|
69
|
+
Commits following these conventions will automatically:
|
|
70
|
+
|
|
71
|
+
1. **Trigger releases** when pushed to `main`
|
|
72
|
+
2. **Generate changelogs** based on commit messages
|
|
73
|
+
3. **Bump versions** according to semantic versioning:
|
|
74
|
+
- `fix:` → patch release (1.0.0 → 1.0.1)
|
|
75
|
+
- `feat:` → minor release (1.0.0 → 1.1.0)
|
|
76
|
+
- `feat!:` → major release (1.0.0 → 2.0.0)
|
|
77
|
+
|
|
78
|
+
## CI/CD Integration
|
|
79
|
+
|
|
80
|
+
The automated release process includes:
|
|
81
|
+
- ✅ Linting and testing
|
|
82
|
+
- ✅ Package building
|
|
83
|
+
- ✅ NPM publishing with OIDC authentication
|
|
84
|
+
- ✅ Changelog generation
|
|
85
|
+
- ✅ Git tag creation
|
|
86
|
+
- ✅ Release notes generation
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
# OIDC Trusted Publisher Setup
|
|
2
|
+
|
|
3
|
+
This guide helps you set up OIDC (OpenID Connect) trusted publisher for automated publishing to package registries.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
OIDC trusted publisher allows you to publish packages without storing long-lived tokens or passwords in your CI/CD environment. Instead, it uses short-lived tokens issued by the OIDC provider.
|
|
8
|
+
|
|
9
|
+
## Supported Registries
|
|
10
|
+
|
|
11
|
+
- **npm**: npm Registry
|
|
12
|
+
- **PyPI**: Python Package Index
|
|
13
|
+
- **Maven Central**: Java packages
|
|
14
|
+
- **NuGet**: .NET packages
|
|
15
|
+
|
|
16
|
+
## Setup Process
|
|
17
|
+
|
|
18
|
+
### 1. Configure OIDC Provider
|
|
19
|
+
|
|
20
|
+
Most CI/CD platforms (GitHub Actions, GitLab CI, etc.) provide built-in OIDC support.
|
|
21
|
+
|
|
22
|
+
**GitHub Actions Example:**
|
|
23
|
+
|
|
24
|
+
```yaml
|
|
25
|
+
# .github/workflows/publish.yml
|
|
26
|
+
name: Publish Package
|
|
27
|
+
|
|
28
|
+
on:
|
|
29
|
+
release:
|
|
30
|
+
types: [published]
|
|
31
|
+
|
|
32
|
+
jobs:
|
|
33
|
+
publish:
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
permissions:
|
|
36
|
+
contents: read
|
|
37
|
+
id-token: write
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v4
|
|
40
|
+
- name: Setup Node.js
|
|
41
|
+
uses: actions/setup-node@v4
|
|
42
|
+
with:
|
|
43
|
+
node-version: '20'
|
|
44
|
+
registry-url: 'https://registry.npmjs.org'
|
|
45
|
+
- name: Install dependencies
|
|
46
|
+
run: npm ci
|
|
47
|
+
- name: Build package
|
|
48
|
+
run: npm run build
|
|
49
|
+
- name: Publish to npm
|
|
50
|
+
run: npm publish
|
|
51
|
+
env:
|
|
52
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 2. Registry Configuration
|
|
56
|
+
|
|
57
|
+
#### npm Registry
|
|
58
|
+
|
|
59
|
+
1. **Create OIDC Integration**:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Using npm CLI
|
|
63
|
+
npm profile enable-2fa auth-and-writes
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
2. **Configure Trusted Publisher**:
|
|
67
|
+
- Go to npmjs.com → Account Settings → Access Tokens
|
|
68
|
+
- Create "Automation" token
|
|
69
|
+
- Configure OIDC integration
|
|
70
|
+
|
|
71
|
+
3. **Repository Settings**:
|
|
72
|
+
```json
|
|
73
|
+
// package.json
|
|
74
|
+
{
|
|
75
|
+
"publishConfig": {
|
|
76
|
+
"registry": "https://registry.npmjs.org/"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
#### PyPI (Python)
|
|
82
|
+
|
|
83
|
+
1. **Create API Token**:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Using twine
|
|
87
|
+
twine upload --config-file ~/.pypirc dist/*
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
2. **OIDC Configuration**:
|
|
91
|
+
```yaml
|
|
92
|
+
# .github/workflows/publish.yml
|
|
93
|
+
- name: Publish to PyPI
|
|
94
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
95
|
+
with:
|
|
96
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 3. Security Best Practices
|
|
100
|
+
|
|
101
|
+
#### Token Management
|
|
102
|
+
|
|
103
|
+
- ✅ **Use short-lived tokens** (1-6 hours)
|
|
104
|
+
- ✅ **Scope tokens to specific repositories**
|
|
105
|
+
- ✅ **Rotate tokens regularly**
|
|
106
|
+
- ❌ **Never store long-lived tokens in code**
|
|
107
|
+
- ❌ **Never commit tokens to version control**
|
|
108
|
+
|
|
109
|
+
#### Environment Variables
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Good: Short-lived, scoped token
|
|
113
|
+
NODE_AUTH_TOKEN=gho_shortlivedtoken123
|
|
114
|
+
|
|
115
|
+
# Bad: Long-lived, broad token
|
|
116
|
+
NPM_TOKEN=longlivedbroadtoken456
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
#### Repository Secrets
|
|
120
|
+
|
|
121
|
+
Store sensitive tokens in repository secrets:
|
|
122
|
+
|
|
123
|
+
**GitHub**: Settings → Secrets and variables → Actions
|
|
124
|
+
**GitLab**: Settings → CI/CD → Variables
|
|
125
|
+
**Azure DevOps**: Pipelines → Library → Variable groups
|
|
126
|
+
|
|
127
|
+
### 4. Testing the Setup
|
|
128
|
+
|
|
129
|
+
#### Local Testing
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# Test with dry run
|
|
133
|
+
npm publish --dry-run
|
|
134
|
+
|
|
135
|
+
# Test with local registry
|
|
136
|
+
npm publish --registry http://localhost:4873
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
#### CI/CD Testing
|
|
140
|
+
|
|
141
|
+
```yaml
|
|
142
|
+
# Add to your workflow for testing
|
|
143
|
+
- name: Test publish (dry run)
|
|
144
|
+
run: npm publish --dry-run
|
|
145
|
+
env:
|
|
146
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### 5. Troubleshooting
|
|
150
|
+
|
|
151
|
+
#### Common Issues
|
|
152
|
+
|
|
153
|
+
**Token Expired**:
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
npm ERR! code E401
|
|
157
|
+
npm ERR! Unable to authenticate, need: Basic
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Solution**: Check token expiration and refresh if needed.
|
|
161
|
+
|
|
162
|
+
**Insufficient Permissions**:
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
npm ERR! code E403
|
|
166
|
+
npm ERR! Forbidden
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Solution**: Verify token has publish permissions for the package.
|
|
170
|
+
|
|
171
|
+
**OIDC Provider Issues**:
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
Error: Failed to get OIDC token
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Solution**: Check OIDC provider configuration and permissions.
|
|
178
|
+
|
|
179
|
+
#### Debug Mode
|
|
180
|
+
|
|
181
|
+
Enable debug logging:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
# npm
|
|
185
|
+
npm config set loglevel verbose
|
|
186
|
+
|
|
187
|
+
# Python
|
|
188
|
+
export TWINE_VERBOSE=1
|
|
189
|
+
|
|
190
|
+
# Maven
|
|
191
|
+
mvn deploy -X
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### 6. Migration from Legacy Tokens
|
|
195
|
+
|
|
196
|
+
If you're migrating from username/password or long-lived tokens:
|
|
197
|
+
|
|
198
|
+
1. **Audit existing tokens**:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
# npm
|
|
202
|
+
npm profile get
|
|
203
|
+
|
|
204
|
+
# List all tokens
|
|
205
|
+
npm token list
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
2. **Revoke old tokens**:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
npm token delete <token-id>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
3. **Update CI/CD workflows**:
|
|
215
|
+
- Replace `NPM_TOKEN` with `NODE_AUTH_TOKEN`
|
|
216
|
+
- Add OIDC permissions
|
|
217
|
+
- Test in staging environment
|
|
218
|
+
|
|
219
|
+
### 7. Monitoring and Alerts
|
|
220
|
+
|
|
221
|
+
Set up monitoring for:
|
|
222
|
+
|
|
223
|
+
- **Publish failures**: Alert on failed deployments
|
|
224
|
+
- **Token expiration**: Proactive token renewal
|
|
225
|
+
- **Security events**: Unusual publish patterns
|
|
226
|
+
- **Registry status**: External service health
|
|
227
|
+
|
|
228
|
+
#### Example Monitoring
|
|
229
|
+
|
|
230
|
+
```yaml
|
|
231
|
+
# .github/workflows/monitor.yml
|
|
232
|
+
name: Monitor Publishing
|
|
233
|
+
|
|
234
|
+
on:
|
|
235
|
+
workflow_run:
|
|
236
|
+
workflows: ['Publish Package']
|
|
237
|
+
types: [completed]
|
|
238
|
+
|
|
239
|
+
jobs:
|
|
240
|
+
monitor:
|
|
241
|
+
runs-on: ubuntu-latest
|
|
242
|
+
steps:
|
|
243
|
+
- name: Check publish status
|
|
244
|
+
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
|
|
245
|
+
run: |
|
|
246
|
+
echo "Publish failed! Check logs."
|
|
247
|
+
# Send alert to Slack/Teams/etc.
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## CAWS Integration
|
|
251
|
+
|
|
252
|
+
For CAWS projects, OIDC setup integrates with:
|
|
253
|
+
|
|
254
|
+
- **Provenance tracking**: Automatic attestation of published packages
|
|
255
|
+
- **Security scanning**: Validation of published artifacts
|
|
256
|
+
- **Quality gates**: Ensure packages meet standards before publish
|
|
257
|
+
|
|
258
|
+
### CAWS-Specific Configuration
|
|
259
|
+
|
|
260
|
+
```yaml
|
|
261
|
+
# .caws/working-spec.yaml
|
|
262
|
+
non_functional:
|
|
263
|
+
security:
|
|
264
|
+
- 'oidc-authentication'
|
|
265
|
+
- 'token-rotation'
|
|
266
|
+
- 'publish-attestation'
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Automated Provenance
|
|
270
|
+
|
|
271
|
+
CAWS automatically generates provenance information:
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
# Generate SBOM and attestation
|
|
275
|
+
caws attest --format=slsa
|
|
276
|
+
|
|
277
|
+
# Validate before publish
|
|
278
|
+
caws validate --security-scan
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## Resources
|
|
282
|
+
|
|
283
|
+
- [npm OIDC Documentation](https://docs.npmjs.com/about-access-tokens)
|
|
284
|
+
- [GitHub Actions OIDC](https://docs.github.com/en/actions/deployment/security/hardening-your-deployments/about-security-hardening-with-openid-connect)
|
|
285
|
+
- [PyPI Trusted Publishing](https://docs.pypi.org/trusted-publishing/)
|
|
286
|
+
- [OIDC Specification](https://openid.net/connect/)
|
|
287
|
+
|
|
288
|
+
## Support
|
|
289
|
+
|
|
290
|
+
For issues with OIDC setup:
|
|
291
|
+
|
|
292
|
+
1. Check the troubleshooting section above
|
|
293
|
+
2. Review registry-specific documentation
|
|
294
|
+
3. Open an issue in the CAWS repository
|
|
295
|
+
4. Contact your organization's security team
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
**Note**: This guide provides general OIDC setup instructions. Always follow your organization's specific security policies and procedures.
|
|
300
|
+
|