-
Notifications
You must be signed in to change notification settings - Fork 85
add sys admin screen for creating realms #426
Conversation
<div class="invalid-feedback"> | ||
{{joinStrings ($realm.ErrorsFor "name") ", "}} | ||
</div> | ||
{{end}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add the help text beneath?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the isn't help text for name, but I added the region code one.
<div class="invalid-feedback"> | ||
{{joinStrings ($realm.ErrorsFor "UseRealmCertificateKey") ", "}} | ||
</div> | ||
{{end}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely want help text for this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added some - hard help text to write.
pkg/database/user.go
Outdated
@@ -35,6 +35,11 @@ type User struct { | |||
AdminRealms []*Realm `gorm:"many2many:admin_realms"` | |||
} | |||
|
|||
// CacheKey returns the key for this user in the distributed cache. | |||
func (u *User) CacheKey() string { | |||
return fmt.Sprintf("users:by_email:%s", u.Email) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm... we cache users by id and email (I think)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where this matters is in middleware/auth.go - line 77ish.
there it is cached by email
it's also interesting that the callback doesn't hit this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh hmmm... it does? Were you seeing something else? Which user query were you running?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the callbacks work - don't know what I Was doing wrong before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
There's a debug printf left, but we can clean that up later
@@ -101,6 +104,7 @@ func (c *Controller) HandleCreateRealm() http.Handler { | |||
|
|||
func (c *Controller) renderNew(ctx context.Context, w http.ResponseWriter, realm *database.Realm) { | |||
m := controller.TemplateMapFromContext(ctx) | |||
fmt.Printf("errors %+v", realm.Errors()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mikehelmick, sethvargo The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Proposed Changes
Release Note