Skip to content

Commit

Permalink
Remove delegation controls from old ids admin for client and api-scope
Browse files Browse the repository at this point in the history
  • Loading branch information
Herdismaria committed May 29, 2024
1 parent 2c6f9f0 commit b67c86f
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 331 deletions.
151 changes: 9 additions & 142 deletions apps/auth-admin-web/components/Client/form/ClientCreateForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -712,149 +712,16 @@ const ClientCreateForm: React.FC<React.PropsWithChildren<Props>> = (
<section className="client_section">
<h3>{localization.sections['delegations'].title}</h3>

<div className="client__container__checkbox__field">
<label
className="client__label"
htmlFor="supportsCustomDelegation"
<p className="client__label">
You can manage these settings in the new IDS Admin on{' '}
<a
href="https://island.is/stjornbord/innskraningarkerfi"
target="_blank"
rel="noreferrer"
>
{
localization.fields['supportsCustomDelegation']
.label
}
</label>
<input
id="supportsCustomDelegation"
type="checkbox"
{...register('client.supportsCustomDelegation')}
defaultChecked={client.supportsCustomDelegation}
className="client__input"
title={
localization.fields['supportsCustomDelegation']
.helpText
}
/>
<HelpBox
helpText={
localization.fields['supportsCustomDelegation']
.helpText
}
/>
</div>

<div className="client__container__checkbox__field">
<label
className="client__label"
htmlFor="supportsLegalGuardians"
>
{localization.fields['supportsLegalGuardians'].label}
</label>
<input
id="supportsLegalGuardians"
type="checkbox"
{...register('client.supportsLegalGuardians')}
defaultChecked={client.supportsLegalGuardians}
className="client__input"
title={
localization.fields['supportsLegalGuardians']
.helpText
}
/>
<HelpBox
helpText={
localization.fields['supportsLegalGuardians']
.helpText
}
/>
</div>

<div className="client__container__checkbox__field">
<label
className="client__label"
htmlFor="supportsPersonalRepresentatives"
>
{
localization.fields[
'supportsPersonalRepresentatives'
].label
}
</label>
<input
id="supportsPersonalRepresentatives"
type="checkbox"
{...register(
'client.supportsPersonalRepresentatives',
)}
defaultChecked={
client.supportsPersonalRepresentatives
}
className="client__input"
title={
localization.fields[
'supportsPersonalRepresentatives'
].helpText
}
/>
<HelpBox
helpText={
localization.fields[
'supportsPersonalRepresentatives'
].helpText
}
/>
</div>

<div className="client__container__checkbox__field">
<label
className="client__label"
htmlFor="supportsProcuringHolders"
>
{
localization.fields['supportsProcuringHolders']
.label
}
</label>
<input
id="supportsProcuringHolders"
type="checkbox"
{...register('client.supportsProcuringHolders')}
defaultChecked={client.supportsProcuringHolders}
className="client__input"
title={
localization.fields['supportsProcuringHolders']
.helpText
}
/>
<HelpBox
helpText={
localization.fields['supportsProcuringHolders']
.helpText
}
/>
</div>

<div className="client__container__checkbox__field">
<label
className="client__label"
htmlFor="promptDelegations"
>
{localization.fields['promptDelegations'].label}
</label>
<input
id="promptDelegations"
type="checkbox"
{...register('client.promptDelegations')}
defaultChecked={client.promptDelegations}
className="client__input"
title={
localization.fields['promptDelegations'].helpText
}
/>
<HelpBox
helpText={
localization.fields['promptDelegations'].helpText
}
/>
</div>
https://island.is/stjornbord/innskraningarkerfi
</a>
</p>
</section>

<div className="client__container__field">
Expand Down
188 changes: 9 additions & 179 deletions apps/auth-admin-web/components/Resource/forms/ApiScopeCreateForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -449,186 +449,16 @@ const ApiScopeCreateForm: React.FC<React.PropsWithChildren<Props>> = (
<section className="api-scope__section">
<h3>{localization.sections['delegations'].title}</h3>

<div className="api-scope-form__container__checkbox__field">
<label
htmlFor="apiScope.grantToAuthenticatedUser"
className="api-scope-form__label"
<p className="client__label">
You can manage these settings in the new IDS Admin on{' '}
<a
href="https://island.is/stjornbord/innskraningarkerfi"
target="_blank"
rel="noreferrer"
>
{localization.fields['grantToAuthenticatedUser'].label}
</label>
<input
id="apiScope.grantToAuthenticatedUser"
{...register('apiScope.grantToAuthenticatedUser')}
type="checkbox"
defaultChecked={props.apiScope.grantToAuthenticatedUser}
className="api-scope-form__checkbox"
title={
localization.fields['grantToAuthenticatedUser'].helpText
}
/>
<HelpBox
helpText={
localization.fields['grantToAuthenticatedUser'].helpText
}
/>
</div>

<div className="api-scope-form__container__checkbox__field">
<label
htmlFor="apiScope.grantToLegalGuardians"
className="api-scope-form__label"
>
{localization.fields['grantToLegalGuardians'].label}
</label>
<input
id="apiScope.grantToLegalGuardians"
{...register('apiScope.grantToLegalGuardians')}
type="checkbox"
defaultChecked={props.apiScope.grantToLegalGuardians}
className="api-scope-form__checkbox"
title={
localization.fields['grantToLegalGuardians'].helpText
}
/>
<HelpBox
helpText={
localization.fields['grantToLegalGuardians'].helpText
}
/>
</div>

<div className="api-scope-form__container__checkbox__field">
<label
htmlFor="apiScope.grantToProcuringHolders"
className="api-scope-form__label"
>
{localization.fields['grantToProcuringHolders'].label}
</label>
<input
id="apiScope.grantToProcuringHolders"
{...register('apiScope.grantToProcuringHolders')}
type="checkbox"
defaultChecked={props.apiScope.grantToProcuringHolders}
className="api-scope-form__checkbox"
title={
localization.fields['grantToProcuringHolders'].helpText
}
/>
<HelpBox
helpText={
localization.fields['grantToProcuringHolders'].helpText
}
/>
</div>

<div className="api-scope-form__container__checkbox__field">
<label
htmlFor="apiScope.grantToPersonalRepresentatives"
className="api-scope-form__label"
>
{
localization.fields['grantToPersonalRepresentatives']
.label
}
</label>
<input
id="apiScope.grantToPersonalRepresentatives"
{...register('apiScope.grantToPersonalRepresentatives')}
type="checkbox"
defaultChecked={
props.apiScope.grantToPersonalRepresentatives
}
className="api-scope-form__checkbox"
title={
localization.fields['grantToPersonalRepresentatives']
.helpText
}
/>
<HelpBox
helpText={
localization.fields['grantToPersonalRepresentatives']
.helpText
}
/>
</div>

<div className="api-scope-form__container__checkbox__field">
<label
htmlFor="apiScope.allowExplicitDelegationGrant"
className="api-scope-form__label"
>
{
localization.fields['allowExplicitDelegationGrant']
.label
}
</label>
<input
id="apiScope.allowExplicitDelegationGrant"
{...register('apiScope.allowExplicitDelegationGrant')}
type="checkbox"
defaultChecked={
props.apiScope.allowExplicitDelegationGrant
}
className="api-scope-form__checkbox"
title={
localization.fields['allowExplicitDelegationGrant']
.helpText
}
/>
<HelpBox
helpText={
localization.fields['allowExplicitDelegationGrant']
.helpText
}
/>
</div>
<div className="api-scope-form__container__checkbox__field">
<label
htmlFor="apiScope.automaticDelegationGrant"
className="api-scope-form__label"
>
{localization.fields['automaticDelegationGrant'].label}
</label>
<input
id="apiScope.automaticDelegationGrant"
{...register('apiScope.automaticDelegationGrant')}
type="checkbox"
defaultChecked={props.apiScope.automaticDelegationGrant}
className="api-scope-form__checkbox"
title={
localization.fields['automaticDelegationGrant'].helpText
}
/>
<HelpBox
helpText={
localization.fields['automaticDelegationGrant'].helpText
}
/>
</div>

<div className="api-scope-form__container__checkbox__field">
<label
htmlFor="apiScope.alsoForDelegatedUser"
className="api-scope-form__label"
>
{localization.fields['alsoForDelegatedUser'].label}
</label>
<input
id="apiScope.alsoForDelegatedUser"
{...register('apiScope.alsoForDelegatedUser')}
type="checkbox"
defaultChecked={props.apiScope.alsoForDelegatedUser}
className="api-scope-form__checkbox"
title={
localization.fields['alsoForDelegatedUser'].helpText
}
/>
<HelpBox
helpText={
localization.fields['alsoForDelegatedUser'].helpText
}
/>
</div>
https://island.is/stjornbord/innskraningarkerfi
</a>
</p>
</section>

<div className="api-scope-form__buttons__container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
ApiResource,
ApiScope,
ApiScopeUserClaim,
ApiScopeDTO,
IdentityResource,
IdentityResourcesDTO,
ResourcesService,
Expand All @@ -19,6 +18,7 @@ import {
PagedRowsDto,
Domain,
DomainDTO,
CreateApiScopeDTO,
} from '@island.is/auth-api-lib'
import { NoContentException } from '@island.is/nest/problem'
import {
Expand Down Expand Up @@ -434,7 +434,7 @@ export class ResourcesController {
@Audit<ApiScope>({
resources: (scope) => scope.name,
})
async createApiScope(@Body() apiScope: ApiScopeDTO): Promise<ApiScope> {
async createApiScope(@Body() apiScope: CreateApiScopeDTO): Promise<ApiScope> {
return this.resourcesService.createApiScope(apiScope)
}

Expand All @@ -456,7 +456,7 @@ export class ResourcesController {
@Put('api-scope/:name')
@ApiOkResponse({ type: ApiScope })
async updateApiScope(
@Body() apiScope: ApiScopeDTO,
@Body() apiScope: CreateApiScopeDTO,
@Param('name') name: string,
@CurrentUser() user: User,
): Promise<ApiScope> {
Expand Down
1 change: 1 addition & 0 deletions libs/auth-api-lib/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export * from './lib/resources/models/api-resource-scope.model'
export * from './lib/resources/models/api-resource-secret.model'
export * from './lib/resources/models/api-resource-user-claim.model'
export * from './lib/resources/models/api-scope.model'
export * from './lib/resources/dto/api-scope-create.dto'
export * from './lib/resources/models/api-scope-user-claim.model'
export * from './lib/resources/models/api-scope-delegation-type.model'
export * from './lib/resources/models/api-scope-group.model'
Expand Down
Loading

0 comments on commit b67c86f

Please sign in to comment.