Giter VIP home page Giter VIP logo

passhport's People

Contributors

aruru99 avatar dependabot[bot] avatar elg avatar eurydice76 avatar iamastealer avatar jorgectf avatar maximiliend avatar phlb avatar raphux avatar raphux-librit avatar spacearrow-tech avatar tonysma avatar verytastytomato avatar yanjost avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

passhport's Issues

Create a Set of installation scripts

The scripts are used to install the soft on an easy way:

  • Check the distribution version
  • Check existing installation
  • Check authorized key file
  • Initialize the database
  • Create first user

File are missing : manage_targetgroup

I miss some files. I guess you forgot to add them. Can you add them ASAP if you have them please.
$ ./passhport-admin
Traceback (most recent call last):
File "./passhport-admin", line 66, in
import manage_targetgroup.prompt_functions as targetgroup_prompt
ImportError: No module named manage_targetgroup.prompt_functions

Installation Doc / Wiki

A installation documentation must be written with all packages to install and some initial commands to test the application.
All of this information has to be a on a single github wiki page.

Code duplication on compatibility

There is too much:
# 2.7 compatibility
try: input = raw_input
except NameError: pass

We need to put that on a module and import it once for all.

Webpage instead of plain text

./passhport-admin usergroup show
Usergroupname:

And let an empty field: I obtain a 404 web page instead of a simple text message.

Inconsistence in URL for editing

In the module user, the URL for editing a user is:

http://127.0.0.1:5000/user/edit

but in the module target, the URL is:

http://127.0.0.1:5000/target/edit/

with a trailing slash. It’s a bit problematic because when we use the URL for editing target without the trailing slash, flask raises:

FormDataRoutingRedirect: A request was sent to this URL (http://127.0.0.1:5000/target/edit)
but a redirect was issued automatically by the routing system to "http://127.0.0.1:5000/target/edit/".
The URL was defined with a trailing slash so Flask will automatically redirect to the URL
with the trailing slash if it was accessed without one.
Make sure to directly send your POST-request to this URL since we can't make browsers
or HTTP clients redirect with form data reliably or without user interaction.

Note: this exception is only raised in debug mode

Add a public sshkey addition

Use case:
I add a new user from the client,
The server add the user to the database,
The server add an entry on the authorized_keys file

Change the database backend easily

Create / modify a script who initialize the database regarding the parameters of the script or a config file... Can be done in shell or python.

Avoid elif on passhport-admin

Even If I've said it was a good way to do it, the code become too complex on argument parsing with a lot of if and elif.
We need to find a new way to do it. TIdeas I have:

  1. Read the docopt doc / ask community about this problem.
  2. Create a simple If / elif on the first level of command and then call function for subcommands.
  3. Looking for a docopt replacement.

Admin client - server interconnexion - all modules

Add an API call on the client side to manage all directly on the server. Using python module "Request" sounds the best.
Use case:
I launch the administration client.
I create a user
The client call the API to create the user
The server create the user and return an error/success code.
The client indicate the result on screen.

The use case has to be declined to all the actions possible between client and server on ALL modules (users, targets, targets groups, user groups...)

Admin client - Server interconnexion

Add an API call on the client side to manage user directly on the server. Using python module "Request" sounds the best.
Use case:
I launch the administration client.
I create a user
The client call the API to create the user
The server create the user and return an error/success code.
The client indicate the result on screen.

The use case has to be declined to all the actions possible between client and server on the USER module

Add users confirmation for deleting things

Before deleting anything user should be asked for confirmation.
We also need to add a "-f" flag to allow deletions without any confirmation

It's a MUST HAVE feature.

Check style

Do we need to jump a line after docstring on each function/method?
def meth()
"""Doc"""

dostuff()

should maybe become

def meth()
"""Doc"""
dostuff()

for more visibility when we have a lot of methods with only 1 line.

Create systemd / initV startup scripts...

Raphux LOVES systemd. So it's for him.

We have to install them during the installation script, and to test them on debian 7 and 8 at least. The scripts only launch the passhportd service.

Passhport client is not plugged to server

The passhport client has to call server API to interrogate user management. This client is used to manage target and users and needs a curl-like interface to interract with server REST API.

replace tar_prompt by target_prompt

The software si designed for adminsys. For all of them, a function named "tar_prompt" will be related to the tool named "tar". Be more explicit don't cost us much.

No more 404 HTTP Error

A 404 is for an url not found. In our case, it's the data which is not found: use a 417.

Add a page on the data model

Describe what a Target is, a user is, a group is.
Explain what is possible to do and why.
Finally describe relations between objects.

Create a set of script to test the clients automatically

The script is written in bash (or sh) and launch the passhport client wiht all options possible.

  1. Create a new database test (on a temporary directory... we don't want erase the actual database)
  2. Every test is run one by one.
  3. All the returns are tested and the result is done at the end of the script (ie: "12/22 tests passsed") and the failed tests are raising an error during the process.
  4. The database is moved/erased. We restore the normal behavior.

Code line limit should be respected

Limit all lines to a maximum of 79 characters.

For flowing long blocks of text with fewer structural restrictions (docstrings or comments), the line length should be limited to 72 characters.

Server - No error when deleting existing users

Use case:
Create a user
Delete this user
Delete again this user => no error is raised.

The Server should return an error indicating that no deletion has been done cause the user don't exist.

Remove useless files from the repository

tests_requests.py should be removed now we have code ready.
test_curl.txt should be transformed into a documentation file/wiki page about the API.

Of course we still need an easy and fast way to test the behavior without any unittest. So we have to create a shell script which execute standard actions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.