Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

[WIP] - Admin view to view _all_ entries #122

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

Conversation

billimek
Copy link
Contributor

@billimek billimek commented Aug 13, 2018

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

@coveralls
Copy link

coveralls commented Aug 13, 2018

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%
Totals Coverage Status
Change from base Build 428: -0.6%
Covered Lines: 252
Relevant Lines: 1504

💛 - Coveralls

Copy link
Owner

@mxschmitt mxschmitt left a comment

Choose a reason for hiding this comment

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

the rest looks good to me

users := r.c.Keys(userToEntriesPrefix + "*")
for _, v := range users.Val() {
logrus.Debugf("got userEntry: %s", v)
// user, err := r.GetEntryByID(string(v))
Copy link
Owner

Choose a reason for hiding this comment

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

please remove the comments

@mxschmitt
Copy link
Owner

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.

@billimek
Copy link
Contributor Author

billimek commented Nov 2, 2018

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?

@mxschmitt mxschmitt self-requested a review February 26, 2019 07:07
@mxschmitt
Copy link
Owner

@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.

@billimek
Copy link
Contributor Author

@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.

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.

3 participants