MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / callHostAuthSave

Method callHostAuthSave

internal/pluginhost/auth_callbacks.go:116–133  ·  view source on GitHub ↗
(ctx context.Context, request []byte)

Source from the content-addressed store, hash-verified

114}
115
116func (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
135func (h *Host) listAuthFiles() ([]pluginapi.HostAuthFileEntry, error) {
136 manager := h.currentAuthManager()

Callers 1

callFromPluginMethod · 0.95

Calls 3

saveAuthFileMethod · 0.95
marshalRPCResultFunction · 0.85

Tested by

no test coverage detected