feat: implement create demo organization - #2009
Conversation
| Picture string `json:"picture"` | ||
| Email string `json:"email"` | ||
| EmailVerified bool `json:"email_verified"` | ||
| EmailVerified bool `json:"verified_email"` |
18bdf3c to
70ff7cd
Compare
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
8890b90 to
c47656c
Compare
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
…keteer into create-demo-org
| if (token == nil || token.OrganizationID == "") && | ||
| strings.HasPrefix(info.FullMethod, createDemoOrganizationName) { | ||
| demoToken, err := verifier.VerifyDemoCreationToken(subs[1]) | ||
| if err != nil { | ||
| return nil, status.Errorf(codes.Unauthenticated, "token is invalid: %s", err.Error()) | ||
| } | ||
| ctx = context.WithValue(ctx, Key, demoToken) | ||
| return handler(ctx, req) | ||
| } |
There was a problem hiding this comment.
You skip the request here for the demo creation here, but you are verifying in the interceptor?
Since you are already verifying the token in the create API, we don't need this code in the interceptor.
There was a problem hiding this comment.
I don't skip the request for the demo creation, that slice only have 3 items. I also didn't verifying the token in the create API, I only get it in here
There was a problem hiding this comment.
Here, you verify the access token for the admin console, but if the request is for the demo creation, it will fail returning the Unauthenticated error, no?
There was a problem hiding this comment.
It won't return error, but it won't contain these information: OrganizationID, IsSystemAdmin, Name
There was a problem hiding this comment.
And since organizationID is empty and IsSystemAdmin is false, the token cannot be used to bypass in any other API
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Part of #1796