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

Add Group Description #8448

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Add Group Description #8448

wants to merge 5 commits into from

Conversation

itaigilo
Copy link
Contributor

Change Description

Background

To make Auth Group more usable, adding a description field to (Auth) Group entities, so there will be easier to distinguish.

New Feature

Add the description field to the Group entity,
And support it in Group creation and Group fetching.

Testing Details

Tested locally,
Added unit-tests.

@itaigilo itaigilo added area/API Improvements or additions to the API improvement area/auth IAM, authorization, authentication, audit, AAA, and integrations with all those include-changelog PR description should be included in next release changelog labels Dec 27, 2024
Copy link

github-actions bot commented Dec 27, 2024

🎊 PR Preview f7b9e69 has been successfully built and deployed to https://treeverse-lakeFS-preview-pr-8448.surge.sh

🕐 Build time: 0.01s

🤖 By surge-preview

Copy link

E2E Test Results - DynamoDB Local - Local Block Adapter

13 passed

Copy link

E2E Test Results - Quickstart

11 passed

@itaigilo itaigilo added exclude-changelog PR description should not be included in next release changelog minor-change Used for PRs that don't require issue attached and removed include-changelog PR description should be included in next release changelog labels Dec 27, 2024
Copy link
Contributor

@arielshaqed arielshaqed left a comment

Choose a reason for hiding this comment

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

Just a drive-by comment about a strange protection mechanism.

@@ -171,6 +175,9 @@ const GroupsContainer = () => {
placeholder="Group Name (e.g. 'DataTeam')"
actionName={"Create"}
validationFunction={disallowPercentSign(INVALID_GROUP_NAME_ERROR_MESSAGE)}
showExtraField={true}
extraPlaceholder="Group Description (optional)"
extraValidationFunction={disallowPercentSign(INVALID_GROUP_DESCRIPTION_ERROR_MESSAGE)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please only add such protections if there is an actual broken case. I always prefer to employ correct quotation mechanisms rather than to attempt to prevent all "bad" cases.

I would expect URI component encoding or whatever to protect percent signs. If things break when descriptions have percent signs, then I expect them also to break in many other cases, such as descriptions with plus signs.

Copy link
Contributor

@nadavsteindler nadavsteindler left a comment

Choose a reason for hiding this comment

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

Looks good. I wrote some comments...

Comment on lines +314 to +320
async getGroup(groupId) {
const response = await apiRequest(`/auth/groups/${encodeURIComponent(groupId)}`);
if (response.status !== 200) {
throw new Error(`could not get groups: ${await extractError(response)}`);
}
return response.json();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need get group, can't we use the information from listing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No -
This page is rendered from the auth/groups/{group-id}/ URL,
So it's rendered without calling the list API.

@@ -959,6 +961,7 @@ func (c *Controller) GetGroup(w http.ResponseWriter, r *http.Request, groupID st

response := apigen.Group{
Id: g.DisplayName,
Description: g.Description,
Copy link
Contributor

Choose a reason for hiding this comment

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

What about list groups?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It wasn't a requirement -
But added now.

Copy link
Contributor

@nadavsteindler nadavsteindler left a comment

Choose a reason for hiding this comment

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

My comments are resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/API Improvements or additions to the API area/auth IAM, authorization, authentication, audit, AAA, and integrations with all those exclude-changelog PR description should not be included in next release changelog improvement minor-change Used for PRs that don't require issue attached
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants