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

Adding detailed mode to occ security:routes #28642

Merged
merged 2 commits into from
Sep 12, 2017
Merged

Adding detailed mode to occ security:routes #28642

merged 2 commits into from
Sep 12, 2017

Conversation

DeepDiver1975
Copy link
Member

@DeepDiver1975 DeepDiver1975 commented Aug 10, 2017

Description

Related Issue

refs https://github.com/owncloud/enterprise/issues/2207

Whats missing?

How Has This Been Tested?

Manual local testing ...

Screenshots (if appropriate):

bildschirmfoto von 2017-09-11 10-57-26

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@PVince81
Copy link
Contributor

what about Webdav routes ?

@PVince81
Copy link
Contributor

do we expect this to make it in 10.0.3 or defer to planned for 10.0.4 ?

@PVince81
Copy link
Contributor

moving to "triage"

@PVince81 PVince81 modified the milestones: triage, development Aug 30, 2017
@phil-davis
Copy link
Contributor

done differently in #28901
@DeepDiver1975 @butonic close here?

@DeepDiver1975 DeepDiver1975 changed the title WIP: add occ command to list all routes Adding detailed mode to occ security:routes Sep 11, 2017
@DeepDiver1975 DeepDiver1975 modified the milestones: development, triage Sep 11, 2017
Copy link
Member

@butonic butonic left a comment

Choose a reason for hiding this comment

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

nice

$collections = $collections + $new;
}

foreach ($collections as $name => $route) {
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to "merge" these 2 loops in order to avoid looping through the list twice?

Copy link
Member Author

Choose a reason for hiding this comment

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

in line 74 the list of collections is compressed to on list of routes

Copy link
Contributor

Choose a reason for hiding this comment

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

premature optimization might not be needed here, considering that this code rarely runs and the number of entries should be small

Copy link
Member

Choose a reason for hiding this comment

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

I meant something like:

foreach ($this->router->getCollections() as $c) {
  $new = $c->all();
  foreach ($new as $name => $route) {
    ....
    $rows[] = array_merge(.....);
  }
}

need to be careful with the $c variable in this case.

usort($rows, function ($a, $b) {
return strcmp($a['path'], $b['path']);
});
$rows = array_map(function($row) {
$row['methods'] = implode(',', $row['methods']);
Copy link
Member

Choose a reason for hiding this comment

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

Move this implode to the row creation (lines 97 and 81) to avoid another list traversal?

Copy link
Member Author

Choose a reason for hiding this comment

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

not really because in line 93 there is a array merge

Copy link
Member

@jvillafanez jvillafanez Sep 11, 2017

Choose a reason for hiding this comment

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

In line 100 you have sort ($rows[$path]['methods']);. You can make the implode after that unless you need the array for something else.
Adjustment will be needed for the other case (lines 81-82)

@jvillafanez
Copy link
Member

I'd add a comment in listControllerNames and listMethodNames to make sure those are used as generators, or maybe change the name to make clear that they'll return generators, not lists.

@butonic butonic merged commit e15370b into master Sep 12, 2017
@butonic butonic deleted the occ-router branch September 12, 2017 12:24
@mmattel
Copy link
Contributor

mmattel commented Sep 12, 2017

@butonic pls create a documentation PR to reflect the new option

@DeepDiver1975
Copy link
Member Author

@butonic @PVince81 backport?

@PVince81
Copy link
Contributor

please backport for 10.0.4

@lock
Copy link

lock bot commented Aug 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants