mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-04 17:01:56 +02:00
reverts
This commit is contained in:
parent
ecb853edbb
commit
2d44669f08
88 changed files with 2597 additions and 1834 deletions
|
@ -1,4 +1,4 @@
|
|||
# 15. Use Django-FSM library for domain application state
|
||||
# 15. Use Django-FSM library for domain request state
|
||||
|
||||
Date: 2022-11-03
|
||||
|
||||
|
@ -10,12 +10,12 @@ Accepted
|
|||
|
||||
The applications that registrants submit for domains move through a variety of
|
||||
different states or stages as they are processed by CISA staff. Traditionally,
|
||||
there would be a “domain application” data model with a “status” field. The
|
||||
there would be a “domain request” data model with a “status” field. The
|
||||
rules in the application code that control what changes are permitted to the
|
||||
statuses are called “domain logic”.
|
||||
|
||||
In a large piece of software, domain logic often spreads around the code base
|
||||
because while handling a single request like “mark this application as
|
||||
because while handling a single request like “mark this domain request as
|
||||
approved”, requirements can be enforced at many different points during the
|
||||
process.
|
||||
|
||||
|
@ -28,7 +28,7 @@ states and can change states (or “transition”) according to fixed rules.
|
|||
We will use the django-fsm library to represent the status of our domain
|
||||
registration applications as a finite state machine. The library allows us to
|
||||
list what statuses are possible and describe which state transitions are
|
||||
possible (e.g. Can an approved application ever be marked as “in-process”?).
|
||||
possible (e.g. Can an approved domain request ever be marked as “in-process”?).
|
||||
|
||||
## Consequences
|
||||
|
||||
|
|
|
@ -8,17 +8,17 @@ Accepted
|
|||
|
||||
## Context
|
||||
|
||||
The application form by which registrants apply for a .gov domain is presented over many pages.
|
||||
The domain request form by which registrants apply for a .gov domain is presented over many pages.
|
||||
|
||||
Because we use server-side rendering, each page of the application is a unique HTML page with form fields surrounded by a form tag.
|
||||
Because we use server-side rendering, each page of the domain request is a unique HTML page with form fields surrounded by a form tag.
|
||||
|
||||
Needing a way to coordinate state between the pages as a user fills in their application, we initially used the Form wizard from [django-formtools](https://django-formtools.readthedocs.io/en/latest/wizard.html). This eventually proved unworkable due to the lack of native ability to have more than one Django form object displayed on a single HTML page.
|
||||
Needing a way to coordinate state between the pages as a user fills in their domain request, we initially used the Form wizard from [django-formtools](https://django-formtools.readthedocs.io/en/latest/wizard.html). This eventually proved unworkable due to the lack of native ability to have more than one Django form object displayed on a single HTML page.
|
||||
|
||||
However, a significant portion of the user workflow had already been coded, so it seemed prudent to port some of the formtools logic into our codebase.
|
||||
|
||||
## Decision
|
||||
|
||||
To maintain each page of the domain application as its own Django view class, inheriting common code from a parent class.
|
||||
To maintain each page of the domain request as its own Django view class, inheriting common code from a parent class.
|
||||
|
||||
To maintain Django form and formset class in accordance with the Django models whose data they collect, independently of the pages on which they appear.
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ Approved
|
|||
## Context
|
||||
|
||||
Our application needs to be able to send email to applicants for various
|
||||
purposes including notifying them that their application has been submitted.
|
||||
purposes including notifying them that their domain request has been submitted.
|
||||
We need infrastructure for programmatically sending email. Amazon Web Services
|
||||
(AWS) provides the Simple Email Service (SES) that can do that. CISA can
|
||||
provide access to AWS SES for our application.
|
||||
|
|
|
@ -8,8 +8,7 @@ Accepted
|
|||
|
||||
## Context
|
||||
|
||||
CISA needs a way to perform administrative actions to manage the new get.gov application as well as the .gov domain
|
||||
application requests submitted. Analysts need to be able to view, review, and approve domain applications. Other
|
||||
CISA needs a way to perform administrative actions to manage the new get.gov application as well as the .gov domain requests submitted. Analysts need to be able to view, review, and approve domain requests. Other
|
||||
dashboard views, reports, searches (with filters and sorting) are also highly desired.
|
||||
|
||||
## Decision
|
||||
|
|
|
@ -8,13 +8,13 @@ Accepted
|
|||
|
||||
## Context
|
||||
|
||||
Historically, the .gov vendor managed initial identity verification and organizational affiliation for users that request a .gov domain. With the new registrar, _any user with a valid Login.gov account_ will be able to make a request. As a primary layer of abuse prevention (i.e., DDoSing the registry program with illegitimate requests), we need a way to stop new users from submitting multiple domain requests before they are known to the .gov registry. In this case, "known" means they have at least one approved domain application or existing domain.
|
||||
Historically, the .gov vendor managed initial identity verification and organizational affiliation for users that request a .gov domain. With the new registrar, _any user with a valid Login.gov account_ will be able to make a request. As a primary layer of abuse prevention (i.e., DDoSing the registry program with illegitimate requests), we need a way to stop new users from submitting multiple domain requests before they are known to the .gov registry. In this case, "known" means they have at least one approved domain request or existing domain.
|
||||
|
||||
## Considered Options
|
||||
|
||||
**Option 1:** Users will not be able to submit any new applications if they have 0 prior approved applications OR prior registered .gov domains. We would add a page alert informing the user that they cannot submit their application because they have an application in one of these "3" statuses (Submitted, In Review or Action Needed). They would still be able to create and edit new applications, just not submit them. The benefits of this option are that it would allow users to have multiple applications essentially in "draft mode" that are queued up and ready for submission after they are permitted to submit.
|
||||
**Option 1:** Users will not be able to submit any new applications if they have 0 prior approved applications OR prior registered .gov domains. We would add a page alert informing the user that they cannot submit their application because they have a domain request in one of these "3" statuses (Submitted, In Review or Action Needed). They would still be able to create and edit new applications, just not submit them. The benefits of this option are that it would allow users to have multiple applications essentially in "draft mode" that are queued up and ready for submission after they are permitted to submit.
|
||||
|
||||
**Option 2:** Users will not be able to submit any new applications if they have 0 prior approved applications OR prior registered .gov domains. Additionally, we would remove the ability to edit any application with the started/withdrawn/rejected status, or start a new application. The benefit of this option is that a user would not be able to begin an action (submitting an application) that they are not allowed to complete.
|
||||
**Option 2:** Users will not be able to submit any new applications if they have 0 prior approved applications OR prior registered .gov domains. Additionally, we would remove the ability to edit any application with the started/withdrawn/rejected status, or start a new application. The benefit of this option is that a user would not be able to begin an action (submitting a domain request) that they are not allowed to complete.
|
||||
|
||||
## Decision
|
||||
|
||||
|
|
|
@ -18,13 +18,13 @@ Deployment_Node(aws, "AWS GovCloud", "Amazon Web Services Region") {
|
|||
Deployment_Node(organization, "get.gov organization") {
|
||||
Deployment_Node(sandbox, "sandbox space") {
|
||||
System_Boundary(dashboard_sandbox, "get.gov registrar") {
|
||||
Container(getgov_app_sandbox, "Registrar Application", "Python, Django", "Delivers static HTML/CSS and forms")
|
||||
Container(getgov_app_sandbox, "Registrar Domain Request", "Python, Django", "Delivers static HTML/CSS and forms")
|
||||
ContainerDb(dashboard_db_sandbox, "sandbox PostgreSQL Database", "AWS RDS", "Stores agency information and reports")
|
||||
}
|
||||
}
|
||||
Deployment_Node(stable, "stable space") {
|
||||
System_Boundary(dashboard_stable, "get.gov registrar") {
|
||||
Container(getgov_app_stable, "Registrar Application", "Python, Django", "Delivers static HTML/CSS and forms")
|
||||
Container(getgov_app_stable, "Registrar Domain Request", "Python, Django", "Delivers static HTML/CSS and forms")
|
||||
ContainerDb(dashboard_db_stable, "stable PostgreSQL Database", "AWS RDS", "Stores agency information and reports")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
This diagram connects the data models along with various workflow stages.
|
||||
|
||||
1. The applicant starts the process at `/request` interacting with the
|
||||
`DomainApplication` object.
|
||||
`DomainRequest` object.
|
||||
|
||||
2. The analyst approves the application using the `DomainApplication`'s
|
||||
2. The analyst approves the domain request using the `DomainRequest`'s
|
||||
`approve()` method which creates many related objects: `UserDomainRole`,
|
||||
`Domain`, and `DomainInformation`.
|
||||
|
||||
|
@ -36,8 +36,8 @@ $ docker run -v $(pwd):$(pwd) -w $(pwd) -it plantuml/plantuml -tsvg model_timeli
|
|||
allowmixing
|
||||
left to right direction
|
||||
|
||||
class DomainApplication {
|
||||
Application for a domain
|
||||
class DomainRequest {
|
||||
Request for a domain
|
||||
--
|
||||
creator (User)
|
||||
investigator (User)
|
||||
|
@ -66,7 +66,7 @@ note left of User
|
|||
<b>username</b> is the Login UUID
|
||||
end note
|
||||
|
||||
DomainApplication -l- User : creator, investigator
|
||||
DomainRequest -l- User : creator, investigator
|
||||
|
||||
class Contact {
|
||||
Contact info for a person
|
||||
|
@ -80,7 +80,7 @@ class Contact {
|
|||
--
|
||||
}
|
||||
|
||||
DomainApplication *-r-* Contact : authorizing_official, submitter, other_contacts
|
||||
DomainRequest *-r-* Contact : authorizing_official, submitter, other_contacts
|
||||
|
||||
class DraftDomain {
|
||||
Requested domain
|
||||
|
@ -89,7 +89,7 @@ class DraftDomain {
|
|||
--
|
||||
}
|
||||
|
||||
DomainApplication -l- DraftDomain : requested_domain
|
||||
DomainRequest -l- DraftDomain : requested_domain
|
||||
|
||||
class Domain {
|
||||
Approved domain
|
||||
|
@ -99,21 +99,21 @@ class Domain {
|
|||
<b>EPP methods</b>
|
||||
}
|
||||
|
||||
DomainApplication .right[#blue].> Domain : approve()
|
||||
DomainRequest .right[#blue].> Domain : approve()
|
||||
|
||||
class DomainInformation {
|
||||
Registrar information on a domain
|
||||
--
|
||||
domain (Domain)
|
||||
domain_application (DomainApplication)
|
||||
domain_request (DomainRequest)
|
||||
security_email
|
||||
--
|
||||
Request information...
|
||||
}
|
||||
|
||||
DomainInformation -- Domain
|
||||
DomainInformation -- DomainApplication
|
||||
DomainApplication .[#blue].> DomainInformation : approve()
|
||||
DomainInformation -- DomainRequest
|
||||
DomainRequest .[#blue].> DomainInformation : approve()
|
||||
|
||||
class UserDomainRole {
|
||||
Permissions
|
||||
|
@ -125,7 +125,7 @@ class UserDomainRole {
|
|||
}
|
||||
UserDomainRole -- User
|
||||
UserDomainRole -- Domain
|
||||
DomainApplication .[#blue].> UserDomainRole : approve()
|
||||
DomainRequest .[#blue].> UserDomainRole : approve()
|
||||
|
||||
class DomainInvitation {
|
||||
Email invitations sent
|
||||
|
@ -139,10 +139,10 @@ DomainInvitation -- Domain
|
|||
DomainInvitation .[#green].> UserDomainRole : User.on_each_login()
|
||||
|
||||
actor applicant #Red
|
||||
applicant -d-> DomainApplication : **/request**
|
||||
applicant -d-> DomainRequest : **/request**
|
||||
|
||||
actor analyst #Blue
|
||||
analyst -[#blue]-> DomainApplication : **approve()**
|
||||
analyst -[#blue]-> DomainRequest : **approve()**
|
||||
|
||||
actor user1 #Green
|
||||
user1 -[#green]-> Domain : **/domain/<id>/nameservers**
|
||||
|
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
@ -39,8 +39,8 @@ class "registrar.Contact <Registrar>" as registrar.Contact #d6f4e9 {
|
|||
registrar.Contact -- registrar.User
|
||||
|
||||
|
||||
class "registrar.DomainApplication <Registrar>" as registrar.DomainApplication #d6f4e9 {
|
||||
domain application
|
||||
class "registrar.DomainRequest <Registrar>" as registrar.DomainRequest #d6f4e9 {
|
||||
domain request
|
||||
--
|
||||
+ id (BigAutoField)
|
||||
+ created_at (DateTimeField)
|
||||
|
@ -77,15 +77,15 @@ class "registrar.DomainApplication <Registrar>" as registrar.DomainApplication #
|
|||
# other_contacts (ManyToManyField)
|
||||
--
|
||||
}
|
||||
registrar.DomainApplication -- registrar.User
|
||||
registrar.DomainApplication -- registrar.User
|
||||
registrar.DomainApplication -- registrar.Contact
|
||||
registrar.DomainApplication -- registrar.DraftDomain
|
||||
registrar.DomainApplication -- registrar.Domain
|
||||
registrar.DomainApplication -- registrar.Contact
|
||||
registrar.DomainApplication *--* registrar.Website
|
||||
registrar.DomainApplication *--* registrar.Website
|
||||
registrar.DomainApplication *--* registrar.Contact
|
||||
registrar.DomainRequest -- registrar.User
|
||||
registrar.DomainRequest -- registrar.User
|
||||
registrar.DomainRequest -- registrar.Contact
|
||||
registrar.DomainRequest -- registrar.DraftDomain
|
||||
registrar.DomainRequest -- registrar.Domain
|
||||
registrar.DomainRequest -- registrar.Contact
|
||||
registrar.DomainRequest *--* registrar.Website
|
||||
registrar.DomainRequest *--* registrar.Website
|
||||
registrar.DomainRequest *--* registrar.Contact
|
||||
|
||||
|
||||
class "registrar.DomainInformation <Registrar>" as registrar.DomainInformation #d6f4e9 {
|
||||
|
@ -95,7 +95,7 @@ class "registrar.DomainInformation <Registrar>" as registrar.DomainInformation #
|
|||
+ created_at (DateTimeField)
|
||||
+ updated_at (DateTimeField)
|
||||
~ creator (ForeignKey)
|
||||
~ domain_application (OneToOneField)
|
||||
~ domain_request (OneToOneField)
|
||||
+ organization_type (CharField)
|
||||
+ federally_recognized_tribe (BooleanField)
|
||||
+ state_recognized_tribe (BooleanField)
|
||||
|
@ -124,7 +124,7 @@ class "registrar.DomainInformation <Registrar>" as registrar.DomainInformation #
|
|||
--
|
||||
}
|
||||
registrar.DomainInformation -- registrar.User
|
||||
registrar.DomainInformation -- registrar.DomainApplication
|
||||
registrar.DomainInformation -- registrar.DomainRequest
|
||||
registrar.DomainInformation -- registrar.Contact
|
||||
registrar.DomainInformation -- registrar.Domain
|
||||
registrar.DomainInformation -- registrar.Contact
|
||||
|
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
|
@ -78,7 +78,7 @@ Get the secrets from Cloud.gov by running `cf env getgov-YOURSANDBOX`. More info
|
|||
The endpoint /admin can be used to view and manage site content, including but not limited to user information and the list of current applications in the database. To be able to view and use /admin locally:
|
||||
|
||||
1. Login via login.gov
|
||||
2. Go to the home page and make sure you can see the part where you can submit an application
|
||||
2. Go to the home page and make sure you can see the part where you can submit a domain request
|
||||
3. Go to /admin and it will tell you that UUID is not authorized, copy that UUID for use in 4
|
||||
4. in src/registrar/fixtures_users.py add to the `ADMINS` list in that file by adding your UUID as your username along with your first and last name. See below:
|
||||
|
||||
|
@ -93,14 +93,14 @@ The endpoint /admin can be used to view and manage site content, including but n
|
|||
]
|
||||
```
|
||||
|
||||
5. In the browser, navigate to /admin. To verify that all is working correctly, under "domain applications" you should see fake domains with various fake statuses.
|
||||
5. In the browser, navigate to /admin. To verify that all is working correctly, under "domain requests" you should see fake domains with various fake statuses.
|
||||
6. Add an optional email key/value pair
|
||||
|
||||
### Adding an Analyst to /admin
|
||||
Analysts are a variant of the admin role with limited permissions. The process for adding an Analyst is much the same as adding an admin:
|
||||
|
||||
1. Login via login.gov (if you already exist as an admin, you will need to create a separate login.gov account for this: i.e. first.last+1@email.com)
|
||||
2. Go to the home page and make sure you can see the part where you can submit an application
|
||||
2. Go to the home page and make sure you can see the part where you can submit a domain request
|
||||
3. Go to /admin and it will tell you that UUID is not authorized, copy that UUID for use in 4 (this will be a different UUID than the one obtained from creating an admin)
|
||||
4. in src/registrar/fixtures_users.py add to the `STAFF` list in that file by adding your UUID as your username along with your first and last name. See below:
|
||||
|
||||
|
@ -145,7 +145,7 @@ You can change the logging verbosity, if needed. Do a web search for "django log
|
|||
|
||||
## Mock data
|
||||
|
||||
[load.py](../../src/registrar/management/commands/load.py) called from docker-compose (locally) and reset-db.yml (upper) loads the fixtures from [fixtures_user.py](../../src/registrar/fixtures_users.py) and [fixtures_applications.py](../../src/registrar/fixtures_applications.py), giving you some test data to play with while developing.
|
||||
[load.py](../../src/registrar/management/commands/load.py) called from docker-compose (locally) and reset-db.yml (upper) loads the fixtures from [fixtures_user.py](../../src/registrar/fixtures_users.py) and [fixtures_domain_requests.py](../../src/registrar/fixtures_domain_requests.py), giving you some test data to play with while developing.
|
||||
|
||||
See the [database-access README](./database-access.md) for information on how to pull data to update these fixtures.
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
## Status Change Approved
|
||||
- Starting Location: Django Admin
|
||||
- Workflow: Analyst Admin
|
||||
- Workflow Step: Click "Domain applications" -> Click an application in a status of "submitted", "In review", "rejected", or "ineligible" -> Click status dropdown -> (select "approved") -> click "Save"
|
||||
- Notes: Note that this will send an email to the submitter (email listed on Your Contact Information). To test this with your own email, you need to create an application, then set the status to "approved". This will send you an email.
|
||||
- Workflow Step: Click "domain requests" -> Click a domain request in a status of "submitted", "In review", "rejected", or "ineligible" -> Click status dropdown -> (select "approved") -> click "Save"
|
||||
- Notes: Note that this will send an email to the submitter (email listed on Your Contact Information). To test this with your own email, you need to create a domain request, then set the status to "approved". This will send you an email.
|
||||
- [Email Content](https://github.com/cisagov/manage.get.gov/blob/main/src/registrar/templates/emails/status_change_approved.txt)
|
||||
|
||||
### Status Change Approved Subject
|
||||
|
@ -35,8 +35,8 @@
|
|||
## Status Change Rejected
|
||||
- Starting Location: Django Admin
|
||||
- Workflow: Analyst Admin
|
||||
- Workflow Step: Click "Domain applications" -> Click an application in a status of "In review", or "approved" -> Click status dropdown -> (select "rejected") -> click "Save"
|
||||
- Notes: Note that this will send an email to the submitter (email listed on Your Contact Information). To test this with your own email, you need to create an application, then set the status to "in review" (and click save). Then, go back to the same application and set the status to "rejected". This will send you an email.
|
||||
- Workflow Step: Click "domain requests" -> Click a domain request in a status of "In review", or "approved" -> Click status dropdown -> (select "rejected") -> click "Save"
|
||||
- Notes: Note that this will send an email to the submitter (email listed on Your Contact Information). To test this with your own email, you need to create a domain request, then set the status to "in review" (and click save). Then, go back to the same application and set the status to "rejected". This will send you an email.
|
||||
- [Email Content](https://github.com/cisagov/manage.get.gov/blob/main/src/registrar/templates/emails/status_change_rejected.txt)
|
||||
|
||||
### Status Change Rejected Subject
|
||||
|
|
|
@ -114,7 +114,7 @@ that can be used for specific tasks.
|
|||
## Cloud.gov dashboard
|
||||
|
||||
At <https://dashboard.fr.cloud.gov/applications> there is a list for all of the
|
||||
applications that a Cloud.gov user has access to. Clicking on an application
|
||||
applications that a Cloud.gov user has access to. Clicking on a domain request
|
||||
goes to a screen for that individual application, e.g.
|
||||
<https://dashboard.fr.cloud.gov/applications/2oBn9LBurIXUNpfmtZCQTCHnxUM/53b88024-1492-46aa-8fb6-1429bdb35f95/summary>.
|
||||
On that page is a left-hand link for "Log Stream" e.g.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue