Giter Club home page Giter Club logo

gotrue's Introduction

GoTrue

User management for APIs

GoTrue is a small open-source API written in Golang, that can act as a self-standing API service for handling user registration and authentication for Jamstack projects.

It's based on OAuth2 and JWT and will handle user signup, authentication and custom user data.

Configuration

You may configure GoTrue using either a configuration file named .env, environment variables, or a combination of both. Environment variables are prefixed with GOTRUE_, and will always have precedence over values provided via file.

Top-Level

GOTRUE_SITE_URL=https://example.netlify.com/

SITE_URL - string required

The base URL your site is located at. Currently used in combination with other settings to construct URLs used in emails.

OPERATOR_TOKEN - string Multi-instance mode only

The shared secret with an operator (usually Netlify) for this microservice. Used to verify requests have been proxied through the operator and the payload values can be trusted.

DISABLE_SIGNUP - bool

When signup is disabled the only way to create new users is through invites. Defaults to false, all signups enabled.

GOTRUE_RATE_LIMIT_HEADER - string

Header on which to rate limit the /token endpoint.

API

GOTRUE_API_HOST=localhost
PORT=9999

API_HOST - string

Hostname to listen on.

PORT (no prefix) / API_PORT - number

Port number to listen on. Defaults to 8081.

API_ENDPOINT - string Multi-instance mode only

Controls what endpoint Netlify can access this API on.

REQUEST_ID_HEADER - string

If you wish to inherit a request ID from the incoming request, specify the name in this value.

Database

GOTRUE_DB_DRIVER=mysql
DATABASE_URL=root@localhost/gotrue

DB_DRIVER - string required

Chooses what dialect of database you want. Must be mysql.

DATABASE_URL (no prefix) / DB_DATABASE_URL - string required

Connection string for the database.

DB_NAMESPACE - string

Adds a prefix to all table names.

Migrations Note

Migrations are not applied automatically, so you will need to run them after you've built gotrue.

  • If built locally: ./gotrue migrate
  • Using Docker: docker run --rm gotrue gotrue migrate

Logging

LOG_LEVEL=debug # available without GOTRUE prefix (exception)
GOTRUE_LOG_FILE=/var/log/go/gotrue.log

LOG_LEVEL - string

Controls what log levels are output. Choose from panic, fatal, error, warn, info, or debug. Defaults to info.

LOG_FILE - string

If you wish logs to be written to a file, set log_file to a valid file path.

Opentracing

Currently, only the Datadog tracer is supported.

GOTRUE_TRACING_ENABLED=true
GOTRUE_TRACING_HOST=127.0.0.1
GOTRUE_TRACING_PORT=8126
GOTRUE_TRACING_TAGS="tag1:value1,tag2:value2"
GOTRUE_SERVICE_NAME="gotrue"

TRACING_ENABLED - bool

Whether tracing is enabled or not. Defaults to false.

TRACING_HOST - bool

The tracing destination.

TRACING_PORT - bool

The port for the tracing host.

TRACING_TAGS - string

A comma separated list of key:value pairs. These key value pairs will be added as tags to all opentracing spans.

SERVICE_NAME - string

The name to use for the service.

JSON Web Tokens (JWT)

GOTRUE_JWT_SECRET=supersecretvalue
GOTRUE_JWT_EXP=3600
GOTRUE_JWT_AUD=netlify

JWT_SECRET - string required

The secret used to sign JWT tokens with.

JWT_EXP - number

How long tokens are valid for, in seconds. Defaults to 3600 (1 hour).

JWT_AUD - string

The default JWT audience. Use audiences to group users.

JWT_ADMIN_GROUP_NAME - string

The name of the admin group (if enabled). Defaults to admin.

JWT_DEFAULT_GROUP_NAME - string

The default group to assign all new users to.

External Authentication Providers

We support bitbucket, github, gitlab, and google for external authentication. Use the names as the keys underneath external to configure each separately.

GOTRUE_EXTERNAL_GITHUB_CLIENT_ID=myappclientid
GOTRUE_EXTERNAL_GITHUB_SECRET=clientsecretvaluessssh

No external providers are required, but you must provide the required values if you choose to enable any.

EXTERNAL_X_ENABLED - bool

Whether this external provider is enabled or not

EXTERNAL_X_CLIENT_ID - string required

The OAuth2 Client ID registered with the external provider.

EXTERNAL_X_SECRET - string required

The OAuth2 Client Secret provided by the external provider when you registered.

EXTERNAL_X_REDIRECT_URI - string required for gitlab

The URI a OAuth2 provider will redirect to with the code and state values.

EXTERNAL_X_URL - string

The base URL used for constructing the URLs to request authorization and access tokens. Used by gitlab only. Defaults to https://gitlab.com.

E-Mail

Sending email is not required, but highly recommended for password recovery. If enabled, you must provide the required values below.

GOTRUE_SMTP_HOST=smtp.mandrillapp.com
GOTRUE_SMTP_PORT=587
GOTRUE_SMTP_USER[email protected]
GOTRUE_SMTP_PASS=correcthorsebatterystaple
GOTRUE_SMTP_ADMIN_EMAIL[email protected]
GOTRUE_MAILER_SUBJECTS_CONFIRMATION="Please confirm"

SMTP_ADMIN_EMAIL - string required

The From email address for all emails sent.

SMTP_HOST - string required

The mail server hostname to send emails through.

SMTP_PORT - number required

The port number to connect to the mail server on.

SMTP_USER - string

If the mail server requires authentication, the username to use.

SMTP_PASS - string

If the mail server requires authentication, the password to use.

SMTP_MAX_FREQUENCY - number

Controls the minimum amount of time that must pass before sending another signup confirmation or password reset email. The value is the number of seconds. Defaults to 900 (15 minutes).

MAILER_AUTOCONFIRM - bool

If you do not require email confirmation, you may set this to true. Defaults to false.

MAILER_URLPATHS_INVITE - string

URL path to use in the user invite email. Defaults to /.

MAILER_URLPATHS_CONFIRMATION - string

URL path to use in the signup confirmation email. Defaults to /.

MAILER_URLPATHS_RECOVERY - string

URL path to use in the password reset email. Defaults to /.

MAILER_URLPATHS_EMAIL_CHANGE - string

URL path to use in the email change confirmation email. Defaults to /.

MAILER_SUBJECTS_INVITE - string

Email subject to use for user invite. Defaults to You have been invited.

MAILER_SUBJECTS_CONFIRMATION - string

Email subject to use for signup confirmation. Defaults to Confirm Your Signup.

MAILER_SUBJECTS_RECOVERY - string

Email subject to use for password reset. Defaults to Reset Your Password.

MAILER_SUBJECTS_EMAIL_CHANGE - string

Email subject to use for email change confirmation. Defaults to Confirm Email Change.

MAILER_TEMPLATES_INVITE - string

URL path to an email template to use when inviting a user. SiteURL, Email, and ConfirmationURL variables are available.

Default Content (if template is unavailable):

<h2>You have been invited</h2>

<p>You have been invited to create a user on {{ .SiteURL }}. Follow this link to accept the invite:</p>
<p><a href="{{ .ConfirmationURL }}">Accept the invite</a></p>

MAILER_TEMPLATES_CONFIRMATION - string

URL path to an email template to use when confirming a signup. SiteURL, Email, and ConfirmationURL variables are available.

Default Content (if template is unavailable):

<h2>Confirm your signup</h2>

<p>Follow this link to confirm your user:</p>
<p><a href="{{ .ConfirmationURL }}">Confirm your mail</a></p>

MAILER_TEMPLATES_RECOVERY - string

URL path to an email template to use when resetting a password. SiteURL, Email, and ConfirmationURL variables are available.

Default Content (if template is unavailable):

<h2>Reset Password</h2>

<p>Follow this link to reset the password for your user:</p>
<p><a href="{{ .ConfirmationURL }}">Reset Password</a></p>

MAILER_TEMPLATES_EMAIL_CHANGE - string

URL path to an email template to use when confirming the change of an email address. SiteURL, Email, NewEmail, and ConfirmationURL variables are available.

Default Content (if template is unavailable):

<h2>Confirm Change of Email</h2>

<p>Follow this link to confirm the update of your email from {{ .Email }} to {{ .NewEmail }}:</p>
<p><a href="{{ .ConfirmationURL }}">Change Email</a></p>

WEBHOOK_URL - string

Url of the webhook receiver endpoint. This will be called when events like validate, signup or login occur.

WEBHOOK_SECRET - string

Shared secret to authorize webhook requests. This secret signs the JSON Web Signature of the request. You should use this to verify the integrity of the request. Otherwise others can feed your webhook receiver with fake data.

WEBHOOK_RETRIES - number

How often GoTrue should try a failed hook.

WEBHOOK_TIMEOUT_SEC - number

Time between retries (in seconds).

WEBHOOK_EVENTS - list

Which events should trigger a webhook. You can provide a comma separated list. For example to listen to all events, provide the values validate,signup,login.

Endpoints

GoTrue exposes the following endpoints:

  • GET /settings

    Returns the publicly available settings for this gotrue instance.

    {
      "external": {
        "bitbucket": true,
        "github": true,
        "gitlab": true,
        "google": true
      },
      "disable_signup": false,
      "autoconfirm": false
    }
  • POST /signup

    Register a new user with an email and password.

    {
      "email": "[email protected]",
      "password": "secret"
    }

    Returns:

    {
      "id": "11111111-2222-3333-4444-5555555555555",
      "email": "[email protected]",
      "confirmation_sent_at": "2016-05-15T20:49:40.882805774-07:00",
      "created_at": "2016-05-15T19:53:12.368652374-07:00",
      "updated_at": "2016-05-15T19:53:12.368652374-07:00"
    }
  • POST /invite

    Invites a new user with an email.

    {
      "email": "[email protected]"
    }

    Returns:

    {
      "id": "11111111-2222-3333-4444-5555555555555",
      "email": "[email protected]",
      "confirmation_sent_at": "2016-05-15T20:49:40.882805774-07:00",
      "created_at": "2016-05-15T19:53:12.368652374-07:00",
      "updated_at": "2016-05-15T19:53:12.368652374-07:00",
      "invited_at": "2016-05-15T19:53:12.368652374-07:00"
    }
  • POST /verify

    Verify a registration or a password recovery. Type can be signup or recovery and the token is a token returned from either /signup or /recover.

    {
      "type": "signup",
      "token": "confirmation-code-delivered-in-email",
      "password": "12345abcdef"
    }

    password is required for signup verification if no existing password exists.

    Returns:

    {
      "access_token": "jwt-token-representing-the-user",
      "token_type": "bearer",
      "expires_in": 3600,
      "refresh_token": "a-refresh-token"
    }
  • POST /recover

    Password recovery. Will deliver a password recovery mail to the user based on email address.

    {
      "email": "[email protected]"
    }

    Returns:

    {}
  • POST /token

    This is an OAuth2 endpoint that currently implements the password, refresh_token, and authorization_code grant types

    grant_type=password&[email protected]&password=secret
    

    or

    grant_type=refresh_token&refresh_token=my-refresh-token
    

    Once you have an access token, you can access the methods requiring authentication by settings the Authorization: Bearer YOUR_ACCESS_TOKEN_HERE header.

    Returns:

    {
      "access_token": "jwt-token-representing-the-user",
      "token_type": "bearer",
      "expires_in": 3600,
      "refresh_token": "a-refresh-token"
    }
  • GET /user

    Get the JSON object for the logged in user (requires authentication)

    Returns:

    {
      "id": "11111111-2222-3333-4444-5555555555555",
      "email": "[email protected]",
      "confirmation_sent_at": "2016-05-15T20:49:40.882805774-07:00",
      "created_at": "2016-05-15T19:53:12.368652374-07:00",
      "updated_at": "2016-05-15T19:53:12.368652374-07:00"
    }
  • PUT /user

    Update a user (Requires authentication). Apart from changing email/password, this method can be used to set custom user data.

    {
      "email": "[email protected]",
      "password": "new-password",
      "data": {
        "key": "value",
        "number": 10,
        "admin": false
      }
    }

    Returns:

    {
      "id": "11111111-2222-3333-4444-5555555555555",
      "email": "[email protected]",
      "confirmation_sent_at": "2016-05-15T20:49:40.882805774-07:00",
      "created_at": "2016-05-15T19:53:12.368652374-07:00",
      "updated_at": "2016-05-15T19:53:12.368652374-07:00"
    }
  • POST /logout

    Logout a user (Requires authentication).

    This will revoke all refresh tokens for the user. Remember that the JWT tokens will still be valid for stateless auth until they expire.

TODO

  • Schema for custom user data in config file

gotrue's People

Contributors

0xflotus avatar bcomnes avatar biilmann avatar brycekahle avatar calavera avatar cassidoo avatar edevil avatar eliwilliamson avatar erezrokah avatar hubgit avatar hydroid7 avatar imorente avatar ingride avatar jamiemagee avatar jolg42 avatar keiko713 avatar kitop avatar klavavej avatar leomp12 avatar lexicondevil avatar lloydjatkinson avatar mheffner avatar mraerino avatar netlify-bot avatar netlify-team-account-1 avatar paddyohanlon avatar rybit avatar vbrown608 avatar verythorough avatar zshipko 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  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  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

gotrue's Issues

Create hidden instance admin per site

Create hidden instance admin per provisioned site in the API - Right now we use a global token. We should create a Netlify admin per service instance and prevent people from deleting them, via the UI and API.

Provide OpenAPI Docs (fka Swagger)

- Do you want to request a feature or report a bug?

Feature request

- What is my proposal?

I'd like to have a OpenAPI spec for this service. Have you ever considered this?
Dredd can be used for automatic tests of the docs against the codebase.

If you'd favor this, I'd offer to write the spec.


This may also concern stuff like #167 and #165

Reset password comes as a Mandrillapp tracking link with wrong path

- Do you want to request a feature or report a bug?
Bug

- What is the current behavior?
Reset password link is a Mandrill link, which in turn makes the reset password unsuccessful.
After tracking the link, the redirected path is wrong: example.com/#recovery_token=somenumbers
missing admin from the path.

- If the current behavior is a bug, please provide the steps to reproduce.
1.- create a netlifycms instance
2.- change to a theme that uses the simple Netlify Identity login (not the git identity)
3.- Create a user inside app.netlify.com
4.- Send password reset

- What is the expected behavior?
Link is a reset password

- Please mention your Go version, and operating system version.
OSX Sierra,
Go version unknown (command not found)

Missing deps on docker

- Do you want to request a feature or report a bug?
info

- What is the current behavior?
package github.com/mattn/anko/builtins: cannot find package "github.com/mattn/anko/builtins" in any of:
/usr/local/go/src/github.com/mattn/anko/builtins (from $GOROOT)
/go/src/github.com/mattn/anko/builtins (from $GOPATH)

- If the current behavior is a bug, please provide the steps to reproduce.
docker build .

- Please mention your Go version, and operating system version.
golang:1.9.2 Ubuntu 16.04.1 LTS

Allow a user to remain signed in on other devices?

- Do you want to request a feature or report a bug?

feature

- What is the current behavior?

When an authenticated user makes a request to /logout, all the refresh tokens for that user are deleted.

- What is the desired behavior?

When an authenticated user makes a request to /logout including a refresh token, delete only this refresh token, so the user can stay signed in on other devices.

Testing site

We should have a testing site, or a way to boot a site that uses GoTrue to validate that we don't break current features and new features work as expected.

Audit Log

Similar feature to what we have in Netlify. We need to track events in a new table and offer a UI for Netlify Site owners to see activity log. This is related to #124, because that table should also use JSON to better indexing arbitrary data.

Ability to invite a user

- Do you want to request a feature or report a bug?
feature

- What is the current behavior?
n/a

- What is the expected behavior?
When triggered one user (admin level) should be able to invite a new user. We would then send them an email with a signup link that would generate a JWT for them. It would be up to the client to then enforce things like setting up a password.

Delete a user - feature request

Dear Netlify team,
is there a way to delete a user account (by user itself or admin)?

If not, any ETA on this?

Thank you.

Provide method for our customer to discover the "signed-up-and-sent-confirmation-email" state for someone signing in through 3rd party provider in their site code.

- Do you want to request a feature or report a bug?

feature

- What is the current behavior?

*currently there is no way to programatically tell after the signup widget has returned to the specified post-signup location, that there is a pending confirmation email, so the site code can prompt the site visitor to do something about it (e.g. go click a confirmation link)

- If the current behavior is a bug, please provide the steps to reproduce.

- What is the expected behavior?

*customers would like to see some status they can check easily via code that could run on their site + potentially a Lambda function call"

- Please mention your Go version, and operating system version.

netlify hosted gotrue for customer # 2 who uses it.

Postgres Support

- Do you want to request a feature or report a bug?

Feature request

- What is the current behavior?

The docs state only mysql to be supported

- What is the expected behavior?

I'd really like to have postgres support.
What are the steps to get there?
pop should support postgres right?

Retrieve user name and avatar from external providers

- Do you want to request a feature or report a bug?

This is an improvement to the external providers

- What is the current behavior?

Currently, we only retrieve the user email.

- What is the expected behavior?

We should also store user names and avatars from the providers that supply that information. We need to set that into the UserMetadata field.

We need to change this call to return a structure with all the information we need:

params.Email, err = provider.GetUserEmail(ctx, tok)

A more ideal structure would have the email and the metadata field:

type UserProvidedData struct {
  Email string
  Metadata map[string]string
}

- Please mention your Go version, and operating system version.

Document audience

It would be nice to document the audience parameter in more depth in order to communicate how multi-tenancy works.

Feature Request: Implicit Grant

Refresh tokens are not suitable for SPA. Is there a way to disable these or providing the ability to support "Implicity Grant" flow only.

Feature Request: Please support goth auth providers

- Do you want to request a feature or report a bug?
Feature

- What is the current behavior?
Not supported

- If the current behavior is a bug, please provide the steps to reproduce.
N/A

- What is the expected behavior?
Support goth auth providers

- Please mention your Go version, and operating system version.
N/A

goth currently offers support to 40 different providers, instead of/in addition to writing providers individually i.e. bitbucket, github, gitlab, and google I highly recommend developing a "bridge" so any of the providers offered by goth can be used with gotrue.

I am staring to use gotrue in some projects and it would make things a lot easier/more flexible if goth's providers were available in gotrue.

Here is a integration example I found: https://github.com/kataras/iris/blob/fc2cc6048113f1eea8f82cd9b442c736f60ed48d/_examples/authentication/oauth2/main.go

Maybe it could be used as a starting point.

Thanks,

Seb

Tests do not allow parallel execution

- Do you want to request a feature or report a bug?
bug

- What is the current behavior?
Tests must be run in serial execution because they utilize the same database and tables.

- If the current behavior is a bug, please provide the steps to reproduce.
Run tests in parallel mode (without -p 1). You will get intermittent failures.

- What is the expected behavior?
Tests should be allowed to run in parallel. At a minimum each file should be able run in parallel. Ideally each test case could too. See code in 1ee853c for some ideas.

External redirect path + base path

Related to: #102

ie, in general for the CMS, it would make sense that the base path is "/admin" and that all URLs are generated based on that (both redirects after a social login and URLs in emails for confirmation, remember me, etc)
if we had that, I would check the return_to URL in the request for an external provider and verify it like this:

  1. Is the domain/protocol the same as the SiteURL on file?
  2. Is the path a child of the base path

Add Google as an external provider

- Do you want to request a feature or report a bug?

This is an addition to the list of supported providers

- What is the current behavior?

We only support GitHub, GitLab and Bitbucket as providers.

- What is the expected behavior?

We should also support Google to expand the user base to non developer centric providers.

Delete user metadata

This may be a feature request, if it doesn't already exist. How do I delete arbitrary user data that I've previously attached? I can overwrite it by submitting new data with matching keys, but submitting the value as undefined (similar to React state's method) didn't do anything and by design empty keys don't do anything.

Disable username/password auth

- Do you want to request a feature or report a bug?

This is a feature request.

- What is the current behavior?

Currently, signing up with username and password cannot be disabled, even if you don't want to offer that functionality.

- What is the expected behavior?

The more I think about this, the more I believe that having two separated auth methods, external and internal, was a mistake. We should keep one single list of enabled auth methods and let instance admins manage them as they wish. All auth methods should expose a common interface to handle signup and login and deal internally with their own logic.

using Netlify ID, Can't login

- Do you want to request a feature or report a bug?
Bug

- What is the current behavior?
Can't login using netlify ID

- If the current behavior is a bug, please provide the steps to reproduce.
Inside app.netlify, go to Identity tab
Go to /admin to login
Try to log in using Netlify ID
Get error message
Related to #113
Note: I signed up using Github, and noticed my Netlify account didn't have a password assigned.

- What is the expected behavior?
Login with Netlify ID works

- Please mention your Go version, and operating system version.
OSX Sierra

`team` category of log actions doesn't match the context

Audit log actions are categorized into four categories: account, team, token, and user (code here)

Because users might fill all sorts of roles, team is confusing, especially considering that this library is also used in the Netlify UI, and in that context, "Team" refers to a completely different group of users.

The team category refers to changes in the user list, so I suggest list, user_list, or maybe membership.

Readme endpoints appear to be incorrect

The endpoints that pertain to administrating users appear to be incorrect. The readme lists things like editing a user's data as PUT /user, but I had to send requests to PUT /admin/users to make things work.

External vendors for transactional emailing

- Do you want to request a feature or report a bug?
feature

- What is the current behavior?
Sending emails requires an email account / server but I would like to use use an external vendor like mailgun, mandrill, (...) that provide a REST API to do the transactional emailing.

- What is the expected behavior?
Instead of defining the host, port, user, pass (...) parameters, a simple webhook / post request would fill my requirements that another small service could do the work.

Maybe there are other options that I'm currently not aware of ;)

Add pagination and sorting as parameters to the admin user list API

- Do you want to request a feature or report a bug?

This is an improvement for the /admin/users endpoint

- What is the current behavior?

When you send a request to the endpoint, you get the list of all users back.

- What is the expected behavior?

We should be able to paginate the list and optionally sort it by creation date, ascending or descending.

Use mail templates hosted on site instead of via configuration

- Do you want to request a feature or report a bug?
feature

- What is the current behavior?
Mail template content is provided via configuration (file/env).

- What is the expected behavior?
Mail templates are fetched from the site. The URL folder to use in combination with the site_url is provided via configuration, with a good default.

ability to control registration style

- Do you want to request a feature or report a bug?
Feature

- What is the current behavior?
n/a

- What is the expected behavior?
The ability to set registration to be

  • open - anyone can signup
  • request - you can ask to signup
  • invite only - only private links

.netlify/identity/settings returns a 404

For some sites (I can't find a way to replicate this, or any correlation between sites it happens on), .netlify/identity/settings returns {code":404,"msg":"Unable to locate site configuration"} instead of the identity settings that are supposed to be loaded. Deleting the identity instance and enabling it again does not reliably make the problem go away, however the problem can go away eventually. I just don't know what causes it or what fixes it. @bcomnes has experienced this, and a user also reported it:

https://app.intercom.io/a/apps/q245f50x/respond/inbox/1479299/conversations/12840437723

In that case above, the issue was no longer evident the next day, and there were no changes made to the site.

[FEATURE] Admin API

- Do you want to request a feature or report a bug?

This is a new feature.

- What is the current behavior?

There is no automatic way to manage users, tokens and roles.

- What is the expected behavior?

We want to have an API for machine users to manage users, tokens, roles and audiences.

This API should be able to:

  • Create users for a given audience with a given role.
  • Remove users from an audience.
  • Modify a user's role in an audience.
  • List users per audience.

Only machine users with a global "superadmin"(or something similar) role should be able to access this api.

create a FAQ

- Do you want to request a feature or report a bug?

feature

- What is the current behavior?

using this code directly is nonintuitive to use for folks doing their own implementation.

- If the current behavior is a bug, please provide the steps to reproduce.

- What is the expected behavior?

it would be great if we had some best practices and gotchas listed here. Gerald knows :allthethings:

- Please mention your Go version, and operating system version.

add facebook login

- Do you want to request a feature or report a bug?

feature

- What is the current behavior?

login providers limited to google + git providers

- If the current behavior is a bug, please provide the steps to reproduce.

- What is the expected behavior?

login providers includes facebook

- Please mention your Go version, and operating system version.

n/a

Twitter and Facebook auth providers

Support Twitter and Facebook as auth providers - Facebook is already implemented and Twitter should be trivial, but we need to put them both in production and test that they work. They should also be added to the checkbox selection in Netlify’s UI.

cannot use pageParams.Offset() (type uint64) storage/sql/storage.go:115:35

- Do you want to request a feature or report a bug?
Bug

- What is the current behavior?

When running go run main.go:

I'm getting the following error:

dev@DevX:[~/go/src/bitbucket.org/project/micro/auth/vendor/github.com/netlify/gotrue]: go run main.go 
# bitbucket.org/project/micro/auth/vendor/github.com/netlify/gotrue/storage/sql
storage/sql/storage.go:115:35: cannot use pageParams.Offset() (type uint64) as type int in argument to q.Offset
storage/sql/storage.go:115:55: cannot use pageParams.PerPage (type uint64) as type int in argument to q.Offset(pageParams.Offset()).Limit

- If the current behavior is a bug, please provide the steps to reproduce.

  • cd into my-path-to/github.com/netlify/gotrue
  • go run main.go

- What is the expected behavior?
Microservice should start

- Please mention your Go version, and operating system version.
Go 1.9, Ubuntu 16.04

Thanks

[FEATURE] Authentication providers

- Do you want to request a feature or report a bug?

This is a new feature.

- What is the current behavior?

Currently, Gotrue only allows people to signup/logic via email / password.

- What is the expected behavior?

We should allow people to configure Gotrue with several authentication providers, like GitHub, GitLab and Bitbucket.

This should be configured globally, and it's probably related to #16.

Incorrect info in the readme

Hello!

I didn't submit a PR for this in case I'm misunderstanding the docs. I'd link to the section but it doesn't have anchors :(

In PUT /user, the sample implies that to update a user with arbitrary data, one must set the data value. This is how gotrue-js works, which makes sense.

That is, submit something like this:

{
  data: {
    "foo": "bar"
  }
}

However, I found that to do this I actually needed to use user_metadata, like this:

{
  user_metadata: {
    "foo": "bar"
  }
}

Is this intentional, or should the documentation be updated?

Redirect back to originating sign in origin

- Do you want to request a feature or report a bug?

bug

- What is the current behavior?

Once git-gateway is successfully set up on a site using Identity, it seems to block login via google

- If the current behavior is a bug, please provide the steps to reproduce.

  • setup git-gateway as a backend for netlify CMS
  • observe that email login still works
  • observe that previously working github login doesn't work (nor does google)

- What is the expected behavior?

  • all account types could work for login

- Please mention your Go version, and operating system version.

Netlify's built-in identity service. More details for the Netlify team in https://app.intercom.io/a/apps/q245f50x/respond/inbox/conversation/11684625129

Make email confirmation flow optional

We need to make email confirmation optional.

The ideal way is to have a way to identify that a user hasn't verified their email yet, and then just have the confirmation mail as a verification step.

We can then make it a setting whether having a verified email is required or not.

cannot use r (type *router) as type "context".Context in argument to chi.ServerBaseContext

- Do you want to request a feature or report a bug?
bug

- What is the current behavior?
Unable to go get

- If the current behavior is a bug, please provide the steps to reproduce.

dev@DevX:[~/go/src/bitbucket.org/project/micro/auth]: go get -u github.com/netlify/gotrue
# github.com/netlify/gocommerce/api
../../../../github.com/netlify/gocommerce/api/api.go:145: cannot use r (type *router) as type "context".Context in argument to chi.ServerBaseContext:
	*router does not implement "context".Context (missing Deadline method)
../../../../github.com/netlify/gocommerce/api/api.go:145: cannot use ctx (type "context".Context) as type http.Handler in argument to chi.ServerBaseContext:
	"context".Context does not implement http.Handler (missing ServeHTTP method)

- What is the expected behavior?
Should be able to install using go get

- Please mention your Go version, and operating system version.

  • go version go1.8.3 linux/amd64
  • ubuntu 16.04

Thanks

Mailer settings cannot be rolled back after setting

- Do you want to request a feature or report a bug?

This is a bug.

- What is the current behavior?

After settings subjects or templates, there is no way to unset them.

- If the current behavior is a bug, please provide the steps to reproduce.

  1. Create an instance with mailer settings
  2. Try unsetting one of the subjects to use the default.

- What is the expected behavior?

We should remove the setting and use the default values.

Password recovery does not confirm email

- Do you want to request a feature or report a bug?
Bug
- What is the current behavior?
Added email manually, I even clicked the reset password from my email, got the "Email not confirmed" message
- If the current behavior is a bug, please provide the steps to reproduce.
Reset password,
Update password
Login
Logout
Login
Enter credentials
screen shot 2017-10-04 at 5 31 09 pm

- What is the expected behavior?
Mail works
- Please mention your Go version, and operating system version.
OSX Sierra

Make golint pass an enable it in Travis to ensure the code remains consistent

- Do you want to request a feature or report a bug?

This is an enhancement to improve code quality.

- What is the current behavior?

Right now we're ignoring Go's linter rules.

- What is the expected behavior?

We should make sure the project passes the linter rules and enable make lint in Travis.

- Please mention your Go version, and operating system version.

Go 1.8 and up.

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.