MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / Info

Method Info

module/application-authorization/iml.go:489–513  ·  view source on GitHub ↗
(ctx context.Context, pid string, aid string)

Source from the content-addressed store, hash-verified

487}
488
489func (i *imlAuthorizationModule) Info(ctx context.Context, pid string, aid string) (*application_authorization_dto.Authorization, error) {
490 _, err := i.serviceService.Get(ctx, pid)
491 if err != nil {
492 return nil, err
493 }
494 auth, err := i.authorizationService.Get(ctx, aid)
495 if err != nil {
496 return nil, err
497 }
498 var cfg map[string]interface{}
499 if auth.Config != "" {
500 _ = json.Unmarshal([]byte(auth.Config), &cfg)
501 }
502
503 return &application_authorization_dto.Authorization{
504 UUID: auth.UUID,
505 Name: auth.Name,
506 Driver: auth.Type,
507 Position: auth.Position,
508 TokenName: auth.TokenName,
509 ExpireTime: auth.ExpireTime,
510 HideCredential: auth.HideCredential,
511 Config: cfg,
512 }, nil
513}

Callers 2

AddAuthorizationMethod · 0.95
EditAuthorizationMethod · 0.95

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected