Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructures Admin Backend #40

Merged
merged 6 commits into from
Dec 14, 2023
Merged

Restructures Admin Backend #40

merged 6 commits into from
Dec 14, 2023

Conversation

Aryan51203
Copy link
Contributor

No description provided.

api/types.go Outdated Show resolved Hide resolved
@pratham1729
Copy link
Contributor

check the kratos.go file in the config folder and make a function for admin URL as well, instead of hardcoding the admin URL everywhere

@pratham1729
Copy link
Contributor

we need to keep all the requests in json format, so change the request from forms to JSON format

config/kratos.go Outdated Show resolved Hide resolved
api/admin.go Outdated
data, _ := json.Marshal(t)
json.Unmarshal(data, &mappedJsonIdentity)

adminCreateIdentityBody := *client.NewAdminCreateIdentityBody(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this to wrapper

api/admin.go Outdated
var mappedJsonIdentity map[string]interface{}

data, _ := json.Marshal(t)
json.Unmarshal(data, &mappedJsonIdentity)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error handling please

api/admin.go Outdated
log.ErrorLogger("Error while calling `AdminCreateIdentity`", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
c.JSON(http.StatusInternalServerError, gin.H{
"error": "INternal server error",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'N' shouldn't be capital

api/admin.go Outdated

var mappedJsonIdentity map[string]interface{}

data, _ := json.Marshal(t)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error handling

api/admin.go Outdated
return
}

jsonString, _ := json.Marshal(getIdentity.Traits)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error handling

api/admin.go Outdated
var identity admin.Identity

if err := json.Unmarshal(jsonString, &identity); err != nil {
fmt.Println(err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use logger

api/admin.go Show resolved Hide resolved
api/mfa.go Outdated
@@ -51,8 +53,11 @@ func HandlePostMFAFlow(c *gin.Context) {
})
return
}
session_cookie, _ := c.Cookie("sdslabs_session")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error handling

@itsdarshankumar
Copy link
Contributor

LGTM

@itsdarshankumar itsdarshankumar merged commit e02c324 into dev Dec 14, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants