mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 11:27:47 +00:00
feat: srp removal
This commit is contained in:
@@ -17,6 +17,7 @@ const (
|
||||
operationCallGetEncryptedWorkspaceKey = "CallGetEncryptedWorkspaceKey"
|
||||
operationCallGetServiceTokenDetails = "CallGetServiceTokenDetails"
|
||||
operationCallLogin1V3 = "CallLogin1V3"
|
||||
operationCallLoginV3 = "CallLoginV3"
|
||||
operationCallVerifyMfaToken = "CallVerifyMfaToken"
|
||||
operationCallLogin2V3 = "CallLogin2V3"
|
||||
operationCallGetAllOrganizations = "CallGetAllOrganizations"
|
||||
@@ -100,6 +101,26 @@ func CallLogin1V2(httpClient *resty.Client, request GetLoginOneV2Request) (GetLo
|
||||
return loginOneV2Response, nil
|
||||
}
|
||||
|
||||
func CallLoginV3(httpClient *resty.Client, request GetLoginV3Request) (GetLoginV3Response, error) {
|
||||
var loginV3Response GetLoginV3Response
|
||||
response, err := httpClient.
|
||||
R().
|
||||
SetResult(&loginV3Response).
|
||||
SetHeader("User-Agent", USER_AGENT).
|
||||
SetBody(request).
|
||||
Post(fmt.Sprintf("%v/v3/auth/login", config.INFISICAL_URL))
|
||||
|
||||
if err != nil {
|
||||
return GetLoginV3Response{}, NewGenericRequestError(operationCallLoginV3, err)
|
||||
}
|
||||
|
||||
if response.IsError() {
|
||||
return GetLoginV3Response{}, NewAPIErrorWithResponse(operationCallLoginV3, response, nil)
|
||||
}
|
||||
|
||||
return loginV3Response, nil
|
||||
}
|
||||
|
||||
func CallVerifyMfaToken(httpClient *resty.Client, request VerifyMfaTokenRequest) (*VerifyMfaTokenResponse, *VerifyMfaTokenErrorResponse, error) {
|
||||
var verifyMfaTokenResponse VerifyMfaTokenResponse
|
||||
var responseError VerifyMfaTokenErrorResponse
|
||||
|
||||
@@ -245,6 +245,15 @@ type GetLoginOneV2Request struct {
|
||||
ClientPublicKey string `json:"clientPublicKey"`
|
||||
}
|
||||
|
||||
type GetLoginV3Request struct {
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
type GetLoginV3Response struct {
|
||||
AccessToken string `json:"accessToken"`
|
||||
}
|
||||
|
||||
type GetLoginOneV2Response struct {
|
||||
ServerPublicKey string `json:"serverPublicKey"`
|
||||
Salt string `json:"salt"`
|
||||
|
||||
Reference in New Issue
Block a user