golang-url-shortener icon indicating copy to clipboard operation
golang-url-shortener copied to clipboard

[WIP] - Admin view to view _all_ entries

Open billimek opened this issue 6 years ago • 5 comments

This PR is a work in progress.

What is the purpose of this PR? . This will enable an 'admin view' such that it is possible to view and delete any of the entries in the system, even if you did not create them.

  • The approach taken is to create a whole new page (/admin) that will work very much like the /recent page but will display all entries for all users.
  • There is currently no restriction on who can view this page as long as they are authenticated with the backend OAuth provider

Some form of protection needs to be added to this - I'm thinking a 'admin password' that would need to be entered by the user would be compared with a configured password. If they match, then allow the user to load the page. I'm not sure how best to go about implementing this part (or open to other ideas as well)

An alternative approach could be to extend the /recent page with a button or some other control that would present the user with a password prompt, and if successful, would re-render the page with all the entries instead of just the entries associated with the user logged-in.

Would love some feedback/suggestions, as not having the ability to see all entries is a limiting factor right now

billimek avatar Aug 13 '18 21:08 billimek

Pull Request Test Coverage Report for Build 429

  • 1 of 60 (1.67%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.6%) to 16.755%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/stores/store.go 0 6 0.0%
internal/handlers/public.go 0 14 0.0%
internal/stores/boltdb/boltdb.go 0 15 0.0%
internal/stores/redis/redis.go 0 24 0.0%
<!-- Total: 1 60
Totals Coverage Status
Change from base Build 428: -0.6%
Covered Lines: 252
Relevant Lines: 1504

💛 - Coveralls

coveralls avatar Aug 13 '18 21:08 coveralls

Hi @billimek, do you have any updates related to the admin panel integration? Do you still need more time, because the title is WIP prefixed.

mxschmitt avatar Nov 02 '18 12:11 mxschmitt

do you have any updates related to the admin panel integration? Do you still need more time, because the title is WIP prefixed.

Hi @mxschmitt no updates since this 'MVP'. I'm personally ok with showing this PR as 'done' and working on (or asking someone else to work on) another one to bake-in some sort of authentication.

Realistically I won't have time for a while to put more effort into this w/respect to further enhancing the admin view thing with more security.

Thoughts?

billimek avatar Nov 02 '18 13:11 billimek

@billimek I really appreciate your effort in this pull request, so I don't want to leave it open. Do you think I can merge it? If not, we can add a "Help wanted" label or something like that, so that other GitHub users can contribute on this feature.

mxschmitt avatar Feb 26 '19 07:02 mxschmitt

@mxschmitt I think help-wanted would be good idea, yeah!

Alternatively, we can complete this one and have an open issue to add authorization to the admin view page.

billimek avatar Feb 26 '19 14:02 billimek