Skip to content

Commit 16fb979

Browse files
authored
Merge pull request #153 from MatthiasGr/est-renewal
Add EST-Based Certificate Renewal
2 parents fd7d66d + d7fe620 commit 16fb979

18 files changed

+335
-8
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ licenseReport {
2626

2727
allprojects {
2828
group = "de.fhg.aisec.ids"
29-
version = "7.2.2"
29+
version = "7.3.0"
3030

3131
val versionRegex = ".*((rc|beta|alpha)-?[0-9]*|-b[0-9.]+)$".toRegex(RegexOption.IGNORE_CASE)
3232

examples/src/main/resources/etc/application.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ logging:
44
de.fhg.aisec.ids.idscp2: trace
55
de.fhg.aisec.ids.camel: trace
66

7+
server:
8+
error:
9+
include-message: always
10+
711
ids-multipart:
812
daps-bean-name: rootDaps
913

47.2 KB
Binary file not shown.

ids-webconsole/src/main/angular/src/app/app.module.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ import { UserService } from './users/user.service';
5454
import { UserCardComponent } from './users/user-card.component';
5555
import { NewIdentityESTComponent } from './keycerts/identitynewest.component';
5656
import { ESTService } from './keycerts/est-service';
57+
import { RenewIdentityESTComponent } from './keycerts/identityrenewest.component';
58+
import { SnackbarComponent } from './keycerts/snackbar.component';
5759

5860
@NgModule({ declarations: [
5961
AppComponent,
@@ -88,7 +90,9 @@ import { ESTService } from './keycerts/est-service';
8890
DetailUserComponent,
8991
UserCardComponent,
9092
UsersComponent,
91-
NewIdentityESTComponent
93+
NewIdentityESTComponent,
94+
RenewIdentityESTComponent,
95+
SnackbarComponent
9296
],
9397
bootstrap: [
9498
AppComponent

ids-webconsole/src/main/angular/src/app/app.routing.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { RouteeditorComponent } from './routes/routeeditor/routeeditor.component
1818
import { UsersComponent } from './users/users.component';
1919
import { NewUserComponent } from './users/usernew.component';
2020
import { DetailUserComponent } from './users/userdetail.component';
21+
import { RenewIdentityESTComponent } from './keycerts/identityrenewest.component';
2122
import { RoutesComponent } from './routes/routes.component';
2223
import { NewIdentityESTComponent } from './keycerts/identitynewest.component';
2324

@@ -43,7 +44,8 @@ const appRoutes: Routes = [
4344
{ path: 'usernew', component: NewUserComponent, canActivate: guards },
4445
{ path: 'userdetail', component: DetailUserComponent, canActivate: guards },
4546
{ path: 'certificates', component: KeycertsComponent, canActivate: guards },
46-
{ path: 'identitynewest', component: NewIdentityESTComponent, canActivate: guards }
47+
{ path: 'identitynewest', component: NewIdentityESTComponent, canActivate: guards },
48+
{ path: 'identityrenewest/:alias', component: RenewIdentityESTComponent, canActivate: guards }
4749
]
4850
},
4951
// Pages using the "login" layout (centered full page without sidebar)

ids-webconsole/src/main/angular/src/app/keycerts/certificate-card.component.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@
77
{{ certificate.subjectDistinguishedName }}
88
</span>
99
</span>
10-
<span class="mdl-list__item-secondary-content" style="text-align:right">
10+
<div class="mdl-list__item-secondary-content" style="text-align:right;align-items:flex-start;flex-direction:row;">
11+
<a *ngIf="onRenewCallback !== null" class="mdl-list__item-secondary-action mdl-color-text--grey-600" (click)="onRenew(certificate.alias)">
12+
<icon class="material-icons">refresh</icon>
13+
</a>
1114
<a class="mdl-list__item-secondary-action mdl-color-text--grey-600" (click)="onDelete(certificate.alias)">
1215
<icon class="material-icons">delete</icon>
1316
</a>
14-
</span>
17+
</div>
1518
</li>
1619
</ul>

ids-webconsole/src/main/angular/src/app/keycerts/certificate-card.component.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export class CertificateCardComponent implements OnInit {
1616
@Input() public certificates: Certificate[];
1717
@Input() public trusts: Certificate[];
1818
@Input() private readonly onDeleteCallback: (alias: string) => void;
19+
@Input() private readonly onRenewCallback: (alias: string) => void = null;
1920
public result: string;
2021

2122
constructor(private readonly confirmService: ConfirmService) {
@@ -29,6 +30,13 @@ export class CertificateCardComponent implements OnInit {
2930
return item.subjectS + item.subjectCN + item.subjectOU + item.subjectO + item.subjectL + item.subjectC;
3031
}
3132

33+
public onRenew(alias: string): void {
34+
// Sanity check
35+
if (this.onRenewCallback) {
36+
this.onRenewCallback(alias);
37+
}
38+
}
39+
3240
public async onDelete(alias: string): Promise<void> {
3341
return this.confirmService.activate('Are you sure that you want to delete this item?')
3442
.then(res => {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export interface EstReEnrollment {
2+
estUrl: string;
3+
rootCertHash: string;
4+
alias: string;
5+
};

ids-webconsole/src/main/angular/src/app/keycerts/est-service.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Observable } from 'rxjs';
44

55
import { environment } from '../../environments/environment';
66
import { EstEnrollment } from './est-enrollment.interface';
7+
import { EstReEnrollment } from './est-re-enrollment.interface';
78

89
@Injectable()
910
export class ESTService {
@@ -40,4 +41,12 @@ export class ESTService {
4041
responseType: 'text'
4142
});
4243
}
44+
45+
// Renew an existing identity identified by its alias via the EST
46+
public renewIdentity(data: EstReEnrollment) {
47+
return this.http.post(environment.apiURL + '/certs/renew_est_identity', data, {
48+
headers: new HttpHeaders({'Content-Type': 'application/json'}),
49+
responseType: 'text'
50+
});
51+
}
4352
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<div class="mdl-grid">
2+
<div class="mdl-card card-dark mdl-cell mdl-cell--12-col">
3+
<div class="mdl-card__title">
4+
<h2 class="mdl-card__title-text">Renew Identity</h2>
5+
</div>
6+
<div class="mdl-card__supporting-text">
7+
<form (ngSubmit)="onSubmit()" class="mdl-cell--12-col mdl-grid">
8+
<div>
9+
<h5>EST Re-Enrollment</h5>
10+
</div>
11+
<div class="mdl-cell--12-col">
12+
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label has-placeholder mdl-cell--12-col form-group">
13+
<label class="mdl-textfield__label" for="estUrl">EST Url*</label>
14+
<input class="mdl-textfield__input" name="estUrl" type="url" [(ngModel)]="estUrl" required>
15+
</div>
16+
</div>
17+
<div class="mdl-cell--12-col">
18+
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label has-placeholder mdl-cell--12-col form-group">
19+
<label class="mdl-textfield__label" for="rootCertHash">Root CA Certificate Hash*</label>
20+
<input class="mdl-textfield__input" name="rootCertHash" type="text" [(ngModel)]="rootCertHash" required>
21+
</div>
22+
</div>
23+
<div class="mdl-cell--12-col" style="margin-top:20px">
24+
<button type="submit" class="mdl-button mdl-color--accent mdl-button--raised">Renew certificate</button>
25+
</div>
26+
</form>
27+
</div>
28+
</div>
29+
</div>
30+
<snackbar #errorSnackbar subtitle="Check the trusted connector log for more details"/>

0 commit comments

Comments
 (0)