(ctx context.Context, request []byte)
| 114 | } |
| 115 | |
| 116 | func (h *Host) callHostAuthSave(ctx context.Context, request []byte) ([]byte, error) { |
| 117 | var req pluginapi.HostAuthSaveRequest |
| 118 | if errUnmarshal := json.Unmarshal(request, &req); errUnmarshal != nil { |
| 119 | return nil, fmt.Errorf("decode host auth save request: %w", errUnmarshal) |
| 120 | } |
| 121 | name, rawJSON, errValidate := validateHostAuthSaveRequest(req) |
| 122 | if errValidate != nil { |
| 123 | return nil, errValidate |
| 124 | } |
| 125 | path, errSave := h.saveAuthFile(ctx, name, rawJSON) |
| 126 | if errSave != nil { |
| 127 | return nil, errSave |
| 128 | } |
| 129 | return marshalRPCResult(pluginapi.HostAuthSaveResponse{ |
| 130 | Name: name, |
| 131 | Path: path, |
| 132 | }) |
| 133 | } |
| 134 | |
| 135 | func (h *Host) listAuthFiles() ([]pluginapi.HostAuthFileEntry, error) { |
| 136 | manager := h.currentAuthManager() |
no test coverage detected