MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / extractAuthInfo

Function extractAuthInfo

app/cli/pkg/action/attestation_init.go:492–510  ·  view source on GitHub ↗
(authToken string)

Source from the content-addressed store, hash-verified

490}
491
492func extractAuthInfo(authToken string) (*clientAPI.Attestation_Auth, error) {
493 if authToken == "" {
494 return nil, errors.New("empty token")
495 }
496
497 parsed, err := token.Parse(authToken)
498 if err != nil {
499 return nil, fmt.Errorf("failed to parse token: %w", err)
500 }
501
502 if parsed == nil {
503 return nil, errors.New("could not determine auth type from token")
504 }
505
506 return &clientAPI.Attestation_Auth{
507 Type: parsed.TokenType,
508 Id: parsed.ID,
509 }, nil
510}
511
512// parseContractV2 attempts to parse a raw contract as V2 schema
513func parseContractV2(rawContract *pb.WorkflowContractVersionItem_RawBody) *v1.CraftingSchemaV2 {

Callers 1

RunMethod · 0.85

Calls 1

ParseFunction · 0.92

Tested by

no test coverage detected