mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
fix(secrets): forward only planned variables into the sandbox and cache repo env resolution
The sandbox shim forwards only the plan's pinned names, so turning sandbox Git credentials off withholds tokens. Sandboxed shells resolve repo env once, terminals on linked servers get no local env, mapping keys cannot override git credentials, masks are kept per directory, and directory resolution is cached. A legacy gh-env alias keeps adopted OpenCode processes working for one release.
This commit is contained in:
1 parent
a0d1d91f18
commit
3e51280894
36 files changed
+1010
-259
No files matched your search
@@ -68,25 +68,28 @@ describe('interpolateEnvExpressions', () => {
|
||||
it('replaces references and interpolates inside a larger string', () => {
|
||||
expect(interpolateEnvExpressions('https://${{ vars.HOST }}/${{ secrets.TOKEN }}', lookup)).toEqual({
|
||||
value: 'https://example.com/super-secret',
|
||||
missing: [],
|
||||
})
|
||||
})
|
||||
|
||||
it('resolves a missing reference to an empty string and reports it', () => {
|
||||
it('resolves a missing reference to an empty string', () => {
|
||||
expect(interpolateEnvExpressions('x-${{ secrets.MISSING }}-y', lookup)).toEqual({
|
||||
value: 'x--y',
|
||||
missing: [{ context: 'secrets', name: 'MISSING' }],
|
||||
})
|
||||
})
|
||||
|
||||
it('leaves an unsupported expression untouched', () => {
|
||||
expect(interpolateEnvExpressions('${{ github.sha }}', lookup)).toEqual({
|
||||
value: '${{ github.sha }}',
|
||||
missing: [],
|
||||
})
|
||||
})
|
||||
|
||||
it('leaves an expression with an invalid name untouched', () => {
|
||||
expect(interpolateEnvExpressions('${{ secrets.1BAD }}', lookup)).toEqual({
|
||||
value: '${{ secrets.1BAD }}',
|
||||
})
|
||||
})
|
||||
|
||||
it('leaves a literal value untouched', () => {
|
||||
expect(interpolateEnvExpressions('literal', lookup)).toEqual({ value: 'literal', missing: [] })
|
||||
expect(interpolateEnvExpressions('literal', lookup)).toEqual({ value: 'literal' })
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user