Skip to content

[web] Add isModeratedSession flag to web ssh session#24238

Merged
avatus merged 4 commits intomasterfrom
michaelmyers/is_moderated_sesion_flag
Apr 12, 2023
Merged

[web] Add isModeratedSession flag to web ssh session#24238
avatus merged 4 commits intomasterfrom
michaelmyers/is_moderated_sesion_flag

Conversation

@avatus
Copy link
Copy Markdown
Contributor

@avatus avatus commented Apr 6, 2023

Part of: #23546

This adds the isModeratedSession flag to new/fetched sessions in the web UI so we can make logic decisions around it (like starting a File Transfer Request).

I decided to name the flag isModeratedSession rather than isModerated because, to me, isModerated sounds like its currently being moderated but, I won't die on that hill and I'm fine to keep it in line with the access evaluator name.

@avatus avatus changed the title Add isModeratedSession flag to web ssh session [web] Add isModeratedSession flag to web ssh session Apr 6, 2023
@avatus avatus requested a review from rudream April 6, 2023 20:03
Comment thread lib/session/session.go Outdated
// Owner is the name of the session owner, ie the one who created the session.
Owner string `json:"owner"`
// IsModeratedSession is true if the session requires moderation.
IsModeratedSession bool `json:"isModeratedSession"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor: everything else in this structure is using underscores, why is this camel case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Was using my frontend brain when I did this part. Thanks for the catch

Comment thread lib/session/session.go Outdated
// Owner is the name of the session owner, ie the one who created the session.
Owner string `json:"owner"`
// IsModeratedSession is true if the session requires moderation.
IsModeratedSession bool `json:"is_moderated_session"`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Consider calling this Moderated instead?

if session.Moderated reads better IMO than if session.IsModeratedSession.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can get behind that. and that removes any "camelcase vs snakecase" argument too, why not

Comment thread lib/web/apiserver.go
Comment thread lib/session/session.go
@ibeckermayer ibeckermayer mentioned this pull request Apr 11, 2023
@avatus avatus added this pull request to the merge queue Apr 12, 2023
Merged via the queue into master with commit d9023fa Apr 12, 2023
@avatus avatus deleted the michaelmyers/is_moderated_sesion_flag branch April 12, 2023 21:42
avatus added a commit that referenced this pull request Apr 19, 2023
* Add isModeratedSession flag to web ssh session

* Fix lint

* Change to snakecase

* Change to moderated
avatus added a commit that referenced this pull request Apr 19, 2023
* Add isModeratedSession flag to web ssh session

* Fix lint

* Change to snakecase

* Change to moderated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants