MCPcopy Create free account
hub / github.com/openclaw/gogcli / ValidateIdentity

Function ValidateIdentity

internal/docsbatch/repository.go:365–378  ·  view source on GitHub ↗
(state *State, identity Identity)

Source from the content-addressed store, hash-verified

363}
364
365func ValidateIdentity(state *State, identity Identity) error {
366 switch {
367 case state.Service != identity.Service:
368 return fmt.Errorf("batch service is %s, not %s: %w", state.Service, identity.Service, ErrIdentityMismatch)
369 case state.DocumentID != identity.DocumentID:
370 return fmt.Errorf("batch targets doc %s, not %s: %w", state.DocumentID, identity.DocumentID, ErrIdentityMismatch)
371 case !strings.EqualFold(state.Account, identity.Account):
372 return fmt.Errorf("batch uses account %s, not %s: %w", state.Account, identity.Account, ErrIdentityMismatch)
373 case state.Client != identity.Client:
374 return fmt.Errorf("batch uses OAuth client %s, not %s: %w", state.Client, identity.Client, ErrIdentityMismatch)
375 default:
376 return nil
377 }
378}
379
380func summarize(state *State) Summary {
381 return Summary{

Callers 2

validateDocsBatchTargetFunction · 0.92
AppendMethod · 0.85

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected