Skip to content

Commit 88e6cb7

Browse files
author
Nicole Garcia
committed
add auth app
1 parent 0498d2e commit 88e6cb7

File tree

30 files changed

+136
-111
lines changed

30 files changed

+136
-111
lines changed

.github/workflows/CD-time-tracker-ui.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
SCOPES: ${{ secrets.scopes }}
3434
CLIENT_ID: ${{ secrets.client_id }}
3535
CLIENT_URL: ${{ secrets.client_url }}
36+
AUTH_URL: ${{ secrets.AUTH_URL }}
37+
AUTH_APP_NAME: ${{ secrets.AUTH_APP_NAME }}
3638
STACK_EXCHANGE_ID: ${{ secrets.stack_exchange_id }}
3739
STACK_EXCHANGE_ACCESS_TOKEN: ${{ secrets.stack_exchange_access_token }}
3840
AZURE_APP_CONFIGURATION_CONNECTION_STRING: ${{ secrets.azure_app_configuration_connection_string }}

.github/workflows/CI-time-tracker-ui.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ jobs:
4646
SCOPES: ${{ secrets.SCOPES }}
4747
CLIENT_ID: ${{ secrets.CLIENT_ID }}
4848
CLIENT_URL : ${{ secrets.CLIENT_URL }}
49+
AUTH_URL: ${{ secrets.AUTH_URL }}
50+
AUTH_APP_NAME: ${{ secrets.AUTH_APP_NAME }}
4951
STACK_EXCHANGE_ID: ${{ secrets.STACK_EXCHANGE_ID }}
5052
STACK_EXCHANGE_ACCESS_TOKEN: ${{ secrets.STACK_EXCHANGE_ACCESS_TOKEN }}
5153
AZURE_APP_CONFIGURATION_CONNECTION_STRING: ${{ secrets.AZURE_APP_CONFIGURATION_CONNECTION_STRING }}

.github/workflows/time-tracker-ui-ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,16 @@ jobs:
2929
with:
3030
ssh-private-key: ${{ secrets.INFRA_TERRAFORM_MODULES_SSH_PRIV_KEY }}
3131

32+
- name: Unlock DEV secrets
33+
uses: sliteteam/[email protected]
34+
env:
35+
GIT_CRYPT_KEY: ${{ secrets.GIT_CRYPT_KEY_DEFAULT }}
36+
3237
- name: build docker
3338
run: make build
3439

3540
- name: Running tests
3641
run: |
37-
chmod -R 777 ./$home
3842
make test
3943
- name: Generate coverage report
4044
env:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ remove: ## Delete container timetracker_ui.
4141
.PHONY: test
4242
test: ## Run all tests on docker container timetracker_ui at the CLI.
4343
docker-compose build timetracker_ui_test
44-
docker-compose up -d timetracker_ui_test
44+
docker-compose --env-file=.dev.env up -d timetracker_ui_test
4545
docker logs -f timetracker_ui_test
4646

4747
.PHONY: testdev

docker-compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ services:
33
timetracker_ui:
44
container_name: timetracker_ui
55
image: timetracker_ui
6+
env_file:
7+
- .dev.env
68
build:
79
context: .
810
dockerfile: ./Docker/Dockerfile.dev
@@ -14,6 +16,8 @@ services:
1416
API_URL: ${API_URL}
1517
CLIENT_ID: ${CLIENT_ID}
1618
CLIENT_URL: ${CLIENT_URL}
19+
AUTH_URL: ${AUTH_URL}
20+
AUTH_APP_NAME: ${AUTH_APP_NAME}
1721
SCOPES: ${SCOPES}
1822
STACK_EXCHANGE_ID: ${STACK_EXCHANGE_ID}
1923
STACK_EXCHANGE_ACCESS_TOKEN: ${STACK_EXCHANGE_ACCESS_TOKEN}

scripts/populate-keys.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ echo "API_URL='$API_URL'" >> .env
55
echo "AUTHORITY='$AUTHORITY'" >> .env
66
echo "CLIENT_ID='$CLIENT_ID'" >> .env
77
echo "CLIENT_URL='$CLIENT_URL'" >> .env
8+
echo "AUTH_URL='$AUTH_URL'" >> .env
9+
echo "AUTH_APP_NAME='$AUTH_APP_NAME'" >> .env
810
echo "SCOPES='$SCOPES'" >> .env
911
echo "STACK_EXCHANGE_ID='$STACK_EXCHANGE_ID'" >> .env
1012
echo "STACK_EXCHANGE_ACCESS_TOKEN='$STACK_EXCHANGE_ACCESS_TOKEN'" >> .env

src/app/modules/activities-management/services/activity.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class ActivityService {
1414
constructor(private http: HttpClient) {}
1515

1616
getActivities(): Observable<Activity[]> {
17-
return this.http.get<Activity[]>(this.baseUrl);
17+
return this.http.get<Activity[]>(this.baseUrl, { withCredentials: true });
1818
}
1919

2020
createActivity(activityData): Observable<any> {
@@ -23,12 +23,12 @@ export class ActivityService {
2323
tenant_id: '4225ab1e-1033-4a5f-8650-0dd4950f38c8',
2424
};
2525

26-
return this.http.post(this.baseUrl, body);
26+
return this.http.post(this.baseUrl, body, { withCredentials: true });
2727
}
2828

2929
deleteActivity(acitivityId: string): Observable<any> {
3030
const url = `${this.baseUrl}/${acitivityId}`;
31-
return this.http.delete(url);
31+
return this.http.delete(url, { withCredentials: true });
3232
}
3333

3434
updateActivity(activityData): Observable<any> {
@@ -38,6 +38,6 @@ export class ActivityService {
3838
...activityData,
3939
};
4040

41-
return this.http.put(url, body);
41+
return this.http.put(url, body, { withCredentials: true });
4242
}
4343
}

src/app/modules/customer-management/components/projects-type/services/project-type.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ export class ProjectTypeService {
1515

1616
getProjectTypes(customerId: any): Observable<ProjectType[]> {
1717
const params = new HttpParams().set('customer_id', customerId.customerId);
18-
return this.http.get<ProjectType[]>(this.baseUrl, { params });
18+
return this.http.get<ProjectType[]>(this.baseUrl, { params, withCredentials: true });
1919
}
2020

2121
createProjectType(projectTypeData): Observable<any> {
22-
return this.http.post(this.baseUrl, projectTypeData);
22+
return this.http.post(this.baseUrl, projectTypeData, { withCredentials: true });
2323
}
2424

2525
deleteProjectType(projectTypeId: string): Observable<any> {
2626
const url = `${this.baseUrl}/${projectTypeId}`;
27-
return this.http.delete(url);
27+
return this.http.delete(url, { withCredentials: true });
2828
}
2929

3030
updateProjectType(projectTypeData): Observable<any> {
3131
const url = `${this.baseUrl}/${projectTypeData.id}`;
32-
return this.http.put(url, projectTypeData);
32+
return this.http.put(url, projectTypeData, { withCredentials: true });
3333
}
3434
}

src/app/modules/customer-management/components/projects/components/services/project.service.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ export class ProjectService {
1717

1818
getProjects(customerId: any): Observable<Project[]> {
1919
const params = new HttpParams().set('customer_id', customerId.customerId);
20-
return this.http.get<Project[]>(this.url, { params });
20+
return this.http.get<Project[]>(this.url, { params, withCredentials: true });
2121
}
2222

2323
getAllProjects(): Observable<Project[]> {
24-
return this.http.get<Project[]>(this.url);
24+
return this.http.get<Project[]>(this.url, { withCredentials: true });
2525
}
2626

2727
getRecentProjects(): Observable<Project[]> {
28-
return this.http.get<Project[]>(`${this.url}/recent`);
28+
return this.http.get<Project[]>(`${this.url}/recent`, { withCredentials: true });
2929
}
3030

3131
createProject(projectData): Observable<any> {
32-
return this.http.post<Project[]>(this.url, projectData);
32+
return this.http.post<Project[]>(this.url, projectData, { withCredentials: true });
3333
}
3434

3535
updateProject(projectData): Observable<any> {
@@ -39,12 +39,12 @@ export class ProjectService {
3939
projectData.status = 1;
4040
}
4141
}
42-
return this.http.put(`${this.url}/${id}`, projectData);
42+
return this.http.put(`${this.url}/${id}`, projectData, { withCredentials: true });
4343
}
4444

4545
deleteProject(projectId: string): Observable<any> {
4646
return this.isDevelopmentOrProd
4747
? this.http.put(`${this.url}/${projectId}`, { status: 0 })
48-
: this.http.delete(`${this.url}/${projectId}`);
48+
: this.http.delete(`${this.url}/${projectId}`, { withCredentials: true });
4949
}
5050
}

src/app/modules/customer-management/services/customer.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ export class CustomerService {
1313
constructor(private http: HttpClient) {}
1414

1515
createCustomer(customerData): Observable<any> {
16-
return this.http.post(this.baseUrl, customerData);
16+
return this.http.post(this.baseUrl, customerData, { withCredentials: true });
1717
}
1818

1919
getCustomers(): Observable<any> {
20-
return this.http.get(this.baseUrl);
20+
return this.http.get(this.baseUrl, { withCredentials: true });
2121
}
2222

2323
deleteCustomer(customerId: string): Observable<any> {
2424
const url = `${this.baseUrl}/${customerId}`;
25-
return this.http.delete(url);
25+
return this.http.delete(url, { withCredentials: true });
2626
}
2727

2828
updateCustomer(customerData): Observable<any> {
2929
const url = `${this.baseUrl}/${customerData.id}`;
30-
return this.http.put(url, customerData);
30+
return this.http.put(url, customerData, { withCredentials: true });
3131
}
3232
}

0 commit comments

Comments
 (0)