Giter Club home page Giter Club logo

usermanager's People

Contributors

calebkleveter avatar dean151 avatar frivas avatar grundoon avatar proggeramlug 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  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

usermanager's Issues

PEM_read_bio_PrivateKey - Unexpectedly found nil while unwrapping an Optional value

Hi,

Could you please help with generating right JWT_PUBLIC and JWT_SECRET?

I'm generating RSA key:
openssl genrsa -out rsa-1024.pem 1024

Then I'm using script from here - #12 and getting N and D

N:
4BuKaDkZohgQLHs0UnWslEP6K7hv9woHOP7jLN/c+YVVcsZjBVQ6IdkLEm6L9E+bENDSAdyVNdQOAAz6gcsSoQzmvNQ5HFpqdnOUH0Qnv4o0fQiAJUalO7y5O0ON9nHvKQRaOnifSPlg9l7ZDwNttz5w7K+FVkmNqHKrtmSVkQU=
D:
AJDffOPPNdDheWMn6jT8OSpHn2uv+UFbzDt+GmGh/fmXxhtCQDTrtAC5jDzIFdVDuNxwAbKOZC69/KbvvOk227zmxtlWbZeFUptwd/bEHbID061E27bQ6VOQl63kCb3WO4f5efXxNvLvxI/fFJX9t9ICJC73n1C+wteXIOzN0Cep

But it doesn't work like that.

image

Admin-Functions

We need functions that are only available to admin users. These include:

  • A list of all users with all their attributes
  • Edit a user and all their attributes
  • Add a new user

GPDR Routes

Creates routes where a user can view and delete all their data:

GET /user/data
DELETE /user/data

Sendgrid integration not quite functional

@calebkleveter test with this send grid key: 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

If you need anything else let me know. Also make sure it uses the localizations properly.

Note: I've made the emailFrom & emailUrl come from the environment variables as well.

error: swift build

screen shot 2019-01-02 at 12 50 57 pm

UserManager/Sources/App/Controllers/AdminController.swift:17:13: error: generic type 'PermissionsMiddleware' specialized with too many typeparameters (got 2, but expected 1)
            PermissionsMiddleware<UserStatus, Payload>(allowed: [.admin]),
            ^                    ~~~~~~~~~~~~~~~~~~~~~
JWTMiddleware.PermissionsMiddleware:1:20: note: generic type 'PermissionsMiddleware' declared here
final public class PermissionsMiddleware<Payload> : Middleware where Payload : PermissionedUserPayload {
                   ^
UserManager/Sources/App/Controllers/AuthController.swift:22:39: error: generic type 'PermissionsMiddleware' specialized with too many type parameters (got 2, but expected 1)
        let restricted = auth.grouped(PermissionsMiddleware<UserStatus, Payload>(allowed: [.admin]))
                                      ^                    ~~~~~~~~~~~~~~~~~~~~~
JWTMiddleware.PermissionsMiddleware:1:20: note: generic type 'PermissionsMiddleware' declared here
final public class PermissionsMiddleware<Payload> : Middleware where Payload : PermissionedUserPayload {
                   ^
error: terminated(1): 

JWT

Could you please explain how to generate this N and D values from JWT? I used JWT with NodeJS but never faced with a manual configuration of those parameters.

Not clear how register (and login) works

Hey @proggeramlug, I tried to walk through register and login method implementations and came up with some questions:

  1. why register returns UserSuccessResponse which doesn't contain any session information (JWT token)
  2. why login requires a request to be authenticated? usually in mobile apps client sends username/pass to get a JWT token.

Run production-tests

We need to be sure this actually does what is says.

I plan to run some local tests and the replace a vapor-2 instance of this service that is used in production. Once this is confirmed we can go public.

Allow other services to integrate

Just like in the vapor 2 version, we need the option for other services like teams, billing etc. to infiltrate their information into the JWT token.

Build Error

AuthController.swift:142:83: error: use of unresolved identifier 'signer'
let refreshJWT = try JWT(from: refreshToken, verifiedUsing: signer.signer)
screen shot 2019-01-09 at 1 26 21 pm

Errors are not very informative

When sending an empty POST request to */users/register I'm getting:

{
  "error": true,
  "reason": "Value of type 'String' required for key ''."
}

Make User registraion public/private

A setting (like the emailconfirmation one) shoul indicate whether or not the public can register themselves. If so the users/register route needs to be protected, if not it can be public.

Swift Tools

Hi,

I have been trouble getting the docker build command to work. I am repeatedly receiving the error /root/vapor: error: package at '/root/vapor' requires a minimum Swift tools version of 5.0.0 (currently 4.2.0). I upgraded to the latest Xcode 11 Beta and selected the latest tools using sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer. Running swiftenv I can see that the selected swift tools are 5.0 at the repository.

Any help would be greatly appreciated!

I ran the following command replacing the JWT_PUBLIC and JWT_SECRET values with generated rsa public and private keys,

docker build . -t users
docker run -e JWT_PUBLIC='n-value-from-jwt' \
-e DATABASE_HOSTNAME='localhost' \
-e DATABASE_USER='users_service' \
-e DATABASE_PASSWORD='users_service' \
-e DATABASE_DB='users_service' \
-e JWT_SECRET='d-value-from-jwt' -p 8080:8080 users

Here are the logs from running the getting started command.

Sending build context to Docker daemon  120.8MB
Step 1/25 : FROM swift:4.2
 ---> ce1fe933c297
Step 2/25 : ARG ENVIRONMENT
 ---> Using cache
 ---> 52c9704beb14
Step 3/25 : ENV ENVIRONMENT ${ENVIRONMENT:-production}
 ---> Using cache
 ---> 525c39d43606
Step 4/25 : ENV DEBIAN_FRONTEND noninteractive
 ---> Using cache
 ---> 6a1dcf17f6cf
Step 5/25 : ENV TZ=Europe/Berlin
 ---> Using cache
 ---> be3ab5a1e6fc
Step 6/25 : ENV TERM xterm
 ---> Using cache
 ---> 509a1f6fd08d
Step 7/25 : RUN apt-get update && apt-get -y install wget lsb-release apt-transport-https
 ---> Using cache
 ---> 1119f8522a86
Step 8/25 : RUN wget -q https://repo.vapor.codes/apt/keyring.gpg -O- | apt-key add -
 ---> Using cache
 ---> 7025dc9a6736
Step 9/25 : RUN echo "deb https://repo.vapor.codes/apt $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/vapor.list
 ---> Using cache
 ---> 4f2e17d46633
Step 10/25 : RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
 ---> Using cache
 ---> f2a799ef60eb
Step 11/25 : USER root
 ---> Using cache
 ---> 150ff5afb19f
Step 12/25 : RUN apt-get update && apt-get install
 ---> Using cache
 ---> e6fea8edc4c2
Step 13/25 : RUN mkdir /root/vapor
 ---> Using cache
 ---> c0b471d1d3d0
Step 14/25 : ADD . /root/vapor
 ---> Using cache
 ---> 48103aec8142
Step 15/25 : WORKDIR /root/vapor
 ---> Using cache
 ---> a0af880d3b4f
Step 16/25 : RUN cd /root/vapor && rm -rf .build
 ---> Using cache
 ---> 8c070f77c9a0
Step 17/25 : RUN swift package update
 ---> Running in d7df9175b541
/root/vapor: error: package at '/root/vapor' requires a minimum Swift tools version of 5.0.0 (currently 4.2.0)
The command '/bin/sh -c swift package update' returned a non-zero code: 1
Unable to find image 'users:latest' locally
docker: Error response from daemon: pull access denied for users, repository does not exist or may require 'docker login'.

Thanks!

Update Documentation for Vapor 3

The README documentation is outdated, with instructions on the JSON config files and other things that have been removed in Vapor 3. The README should be updated for the new platform.

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.