(ctx context.Context, request []byte)
| 93 | } |
| 94 | |
| 95 | func (h *Host) callHostAuthGetRuntime(ctx context.Context, request []byte) ([]byte, error) { |
| 96 | _ = ctx |
| 97 | var req rpcHostAuthGetRequest |
| 98 | if errUnmarshal := json.Unmarshal(request, &req); errUnmarshal != nil { |
| 99 | return nil, fmt.Errorf("decode host auth get runtime request: %w", errUnmarshal) |
| 100 | } |
| 101 | authIndex := strings.TrimSpace(req.AuthIndex) |
| 102 | if authIndex == "" { |
| 103 | return nil, fmt.Errorf("auth_index is required") |
| 104 | } |
| 105 | auth, errGet := h.authByIndex(authIndex) |
| 106 | if errGet != nil { |
| 107 | return nil, errGet |
| 108 | } |
| 109 | entry := h.buildHostAuthFileEntry(auth) |
| 110 | if entry == nil { |
| 111 | return nil, fmt.Errorf("auth runtime info not found for auth_index %s", authIndex) |
| 112 | } |
| 113 | return marshalRPCResult(pluginapi.HostAuthGetRuntimeResponse{Auth: *entry}) |
| 114 | } |
| 115 | |
| 116 | func (h *Host) callHostAuthSave(ctx context.Context, request []byte) ([]byte, error) { |
| 117 | var req pluginapi.HostAuthSaveRequest |
no test coverage detected