-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add org domain whitelisting #289
Conversation
Chief-Rishab
commented
Aug 2, 2023
•
edited
Loading
edited
- Requires feat: add org domain whitelisting proton#295
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
b037b9d
to
45a1382
Compare
Pull Request Test Coverage Report for Build 5842332694
💛 - Coveralls |
name text NOT NULL, | ||
org_id uuid NOT NULL REFERENCES organizations(id) ON DELETE CASCADE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can create a unique constraint on org_id and name. One index on org_id
.
"/raystack.frontier.v1beta1.FrontierService/ListOrganizationDomains": func(ctx context.Context, handler *v1beta1.Handler, req any) error { | ||
pbreq := req.(*frontierv1beta1.ListOrganizationDomainsRequest) | ||
return handler.IsAuthorized(ctx, schema.OrganizationNamespace, pbreq.GetOrgId(), schema.GetPermission) | ||
}, | ||
"/raystack.frontier.v1beta1.FrontierService/GetOrganizationDomain": func(ctx context.Context, handler *v1beta1.Handler, req any) error { | ||
pbreq := req.(*frontierv1beta1.GetOrganizationDomainRequest) | ||
return handler.IsAuthorized(ctx, schema.OrganizationNamespace, pbreq.GetId(), schema.GetPermission) | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering about the authz model, if we expect user already part of the org to find possible orgs to join, how would he join it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's another API for that (get orgs by domain)
core/domain/domain.go
Outdated
Token string | ||
Verified bool | ||
VerifiedAt time.Time | ||
CreatedAt time.Time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about having an expires at column as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was thinking of keeping it abstract since all the verified domains will not require that field, the cron job can be just used to remove the pending state domains with created-at time being more than 7 days
53c1916
to
0953a09
Compare
0953a09
to
c45dca9
Compare
c45dca9
to
ca083a9
Compare
9c53bb3
to
435f204
Compare
InitDomainVerification(ctx context.Context) error | ||
Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we calling these two here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, in the server file to initialise and close the cron to remove the pending records for domain verification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In server file we work with actual struct instead of interface, can you confirm? I think we can remove Close
.
435f204
to
a35650c
Compare
a35650c
to
f840205
Compare
f840205
to
e32f7c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
InitDomainVerification(ctx context.Context) error | ||
Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In server file we work with actual struct instead of interface, can you confirm? I think we can remove Close
.