Skip to content

Commit 9c468c8

Browse files
committed
Allow non-bastion requests to all logs
1 parent 0eef9e9 commit 9c468c8

1 file changed

Lines changed: 3 additions & 16 deletions

File tree

internal/witness/witness.go

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -206,22 +206,9 @@ func (w *Witness) processAddCheckpointRequest(body []byte, bastion string) (cosi
206206
if err != nil {
207207
return nil, err
208208
}
209-
if len(bastions) > 0 {
210-
// Accept requests only via these bastions.
211-
if bastion == "" {
212-
l.Debug("rejected request not using bastion")
213-
return nil, errWrongBastion
214-
}
215-
if !slices.Contains(bastions, bastion) {
216-
l.Debug("rejected request from unexpected bastion", "bastion", bastion)
217-
return nil, errWrongBastion
218-
}
219-
} else {
220-
// Reject requests from log-specific bastions.
221-
if bastion != "" {
222-
l.Debug("rejected request that should not use a bastion", "bastion", bastion)
223-
return nil, errWrongBastion
224-
}
209+
if bastion != "" && !slices.Contains(bastions, bastion) {
210+
l.Debug("rejected request from unexpected bastion", "bastion", bastion)
211+
return nil, errWrongBastion
225212
}
226213
verifier, err := w.getKeys(origin)
227214
if err != nil {

0 commit comments

Comments
 (0)