-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in feature/SHIBUI-580 (pull request #107)
SHIBUI-580 Implemented summary and save of a provider Approved-by: Shibui Jenkins <shibui.jenkins@gmail.com> Approved-by: Ryan Mathis <rmathis@unicon.net>
- Loading branch information
Showing
82 changed files
with
1,896 additions
and
430 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/controller/ErrorResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package edu.internet2.tier.shibboleth.admin.ui.controller; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
|
||
/** | ||
* @author Bill Smith (wsmith@unicon.net) | ||
*/ | ||
@AllArgsConstructor | ||
@Getter | ||
@Setter | ||
@ToString | ||
public class ErrorResponse { | ||
private String errorCode; | ||
private String errorMessage; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
export * from './filter/entity-attributes-filter'; | ||
export * from './provider/file-backed-http-metadata-provider'; | ||
export * from './resolver/file-backed-http-metadata-resolver'; |
104 changes: 0 additions & 104 deletions
104
ui/src/app/metadata/domain/entity/provider/file-backed-http-metadata-provider.spec.ts
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
ui/src/app/metadata/domain/entity/provider/file-backed-http-metadata-provider.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
import { | ||
MetadataBase, | ||
Organization, | ||
Contact, | ||
MDUI, | ||
SecurityInfo, | ||
SsoService, | ||
IdpSsoDescriptor, | ||
LogoutEndpoint, | ||
RelyingPartyOverrides | ||
} from '../model'; | ||
|
||
export interface MetadataProvider extends MetadataBase { | ||
name: string; | ||
'@type': string; | ||
enabled: boolean; | ||
resourceId: string; | ||
} |
5 changes: 5 additions & 0 deletions
5
ui/src/app/metadata/domain/model/providers/file-backed-http-metadata-provider.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { MetadataProvider } from '../metadata-provider'; | ||
|
||
export interface FileBackedHttpMetadataProvider extends MetadataProvider { | ||
metadataFilters: any[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './file-backed-http-metadata-provider'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { TestBed, async, inject } from '@angular/core/testing'; | ||
import { HttpTestingController, HttpClientTestingModule } from '@angular/common/http/testing'; | ||
import { HttpClientModule, HttpRequest } from '@angular/common/http'; | ||
import { MetadataFilterService } from './filter.service'; | ||
import { EntityAttributesFilter } from '../entity'; | ||
|
||
describe(`Metadata Filter Service`, () => { | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [ | ||
HttpClientModule, | ||
HttpClientTestingModule | ||
], | ||
providers: [ | ||
MetadataFilterService | ||
] | ||
}); | ||
}); | ||
|
||
describe('query method', () => { | ||
it(`should send an expected GET[] request`, async(inject([MetadataFilterService, HttpTestingController], | ||
(service: MetadataFilterService, backend: HttpTestingController) => { | ||
service.query().subscribe(); | ||
|
||
backend.expectOne((req: HttpRequest<any>) => { | ||
return req.url === `${service.base}${service.endpoint}` | ||
&& req.method === 'GET'; | ||
}, `GET MetadataResolvers collection`); | ||
} | ||
))); | ||
}); | ||
describe('find method', () => { | ||
it(`should send an expected GET request`, async(inject([MetadataFilterService, HttpTestingController], | ||
(service: MetadataFilterService, backend: HttpTestingController) => { | ||
const id = 'foo'; | ||
service.find(id).subscribe(); | ||
|
||
backend.expectOne((req: HttpRequest<any>) => { | ||
return req.url === `${service.base}${service.endpoint}/${id}` | ||
&& req.method === 'GET'; | ||
}, `GET MetadataResolvers collection`); | ||
} | ||
))); | ||
}); | ||
describe('update method', () => { | ||
it(`should send an expected PUT request`, async(inject([MetadataFilterService, HttpTestingController], | ||
(service: MetadataFilterService, backend: HttpTestingController) => { | ||
const id = 'foo'; | ||
const filter = new EntityAttributesFilter({ id }); | ||
service.update(filter).subscribe(); | ||
|
||
backend.expectOne((req: HttpRequest<any>) => { | ||
return req.url === `${service.base}${service.endpoint}/${id}` | ||
&& req.method === 'PUT'; | ||
}, `PUT (update) MetadataResolvers collection`); | ||
} | ||
))); | ||
}); | ||
describe('save method', () => { | ||
it(`should send an expected POST request`, async(inject([MetadataFilterService, HttpTestingController], | ||
(service: MetadataFilterService, backend: HttpTestingController) => { | ||
const id = 'foo'; | ||
const filter = new EntityAttributesFilter({ id }); | ||
service.save(filter).subscribe(); | ||
|
||
backend.expectOne((req: HttpRequest<any>) => { | ||
return req.url === `${service.base}${service.endpoint}` | ||
&& req.method === 'POST'; | ||
}, `POST MetadataResolvers collection`); | ||
} | ||
))); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { HttpClient } from '@angular/common/http'; | ||
import { Observable } from 'rxjs'; | ||
|
||
import { MetadataFilter } from '../../domain/model'; | ||
|
||
@Injectable() | ||
export class MetadataFilterService { | ||
|
||
readonly endpoint = '/MetadataResolvers'; | ||
readonly base = '/api'; | ||
|
||
constructor( | ||
private http: HttpClient | ||
) { } | ||
query(): Observable<MetadataFilter[]> { | ||
return this.http.get<MetadataFilter[]>(`${this.base}${this.endpoint}`, {}); | ||
} | ||
|
||
find(id: string): Observable<MetadataFilter> { | ||
// console.log(id); | ||
return this.http.get<MetadataFilter>(`${this.base}${this.endpoint}/${id}`); | ||
} | ||
|
||
update(filter: MetadataFilter): Observable<MetadataFilter> { | ||
return this.http.put<MetadataFilter>(`${this.base}${this.endpoint}/${filter.id}`, filter); | ||
} | ||
|
||
save(filter: MetadataFilter): Observable<MetadataFilter> { | ||
return this.http.post<MetadataFilter>(`${this.base}${this.endpoint}`, filter); | ||
} | ||
} |
Oops, something went wrong.