diff --git a/src/app/controller/collection.ts b/src/app/controller/collection.ts index 0c11f8e0..a63bcc48 100644 --- a/src/app/controller/collection.ts +++ b/src/app/controller/collection.ts @@ -2,7 +2,7 @@ import Controller from '@curveball/controller'; import { Context } from '@curveball/core'; import { BadRequest, Conflict, NotFound, UnprocessableEntity } from '@curveball/http-errors'; import * as hal from '../formats/hal'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; type NewPrincipalBody = { nickname: string; diff --git a/src/app/controller/item.ts b/src/app/controller/item.ts index 1fb111c4..32074ceb 100644 --- a/src/app/controller/item.ts +++ b/src/app/controller/item.ts @@ -2,7 +2,7 @@ import Controller from '@curveball/controller'; import { Context } from '@curveball/core'; import * as privilegeService from '../../privilege/service'; import * as hal from '../formats/hal'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; type EditPrincipalBody = { nickname: string; diff --git a/src/app/controller/new.ts b/src/app/controller/new.ts index f5846a35..75ca64b0 100644 --- a/src/app/controller/new.ts +++ b/src/app/controller/new.ts @@ -1,6 +1,6 @@ import Controller from '@curveball/controller'; import { Context } from '@curveball/core'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; import { createAppForm } from '../formats/html'; import { uuidUrn } from '../../crypto'; diff --git a/src/group/controller/collection.ts b/src/group/controller/collection.ts index 8790f29d..a9327d37 100644 --- a/src/group/controller/collection.ts +++ b/src/group/controller/collection.ts @@ -2,7 +2,7 @@ import Controller from '@curveball/controller'; import { Context } from '@curveball/core'; import { BadRequest, Conflict, NotFound } from '@curveball/http-errors'; import * as hal from '../formats/hal'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; type NewPrincipalBody = { nickname: string; diff --git a/src/group/controller/item.ts b/src/group/controller/item.ts index e198b524..296bccf2 100644 --- a/src/group/controller/item.ts +++ b/src/group/controller/item.ts @@ -2,7 +2,7 @@ import Controller from '@curveball/controller'; import { Context } from '@curveball/core'; import * as privilegeService from '../../privilege/service'; import * as hal from '../formats/hal'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; import { NotFound, Conflict } from '@curveball/http-errors'; type EditPrincipalBody = { diff --git a/src/group/controller/new.ts b/src/group/controller/new.ts index e15d230f..6116fe59 100644 --- a/src/group/controller/new.ts +++ b/src/group/controller/new.ts @@ -1,6 +1,6 @@ import Controller from '@curveball/controller'; import { Context } from '@curveball/core'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; import { createGroupForm } from '../formats/html'; import { uuidUrn } from '../../crypto'; diff --git a/src/home/service.ts b/src/home/service.ts index 6a8d53e9..ee1c5cda 100644 --- a/src/home/service.ts +++ b/src/home/service.ts @@ -1,5 +1,5 @@ import { ServerStats } from '../types'; -import { getPrincipalStats } from '../principal/privileged-service'; +import { getPrincipalStats } from '../principal/service'; import { findPrivileges } from '../privilege/service'; import { lastTokenId } from '../oauth2/service'; diff --git a/src/log/controller/user.ts b/src/log/controller/user.ts index 30eb3a16..4237d122 100644 --- a/src/log/controller/user.ts +++ b/src/log/controller/user.ts @@ -1,7 +1,7 @@ import Controller from '@curveball/controller'; import { Context } from '@curveball/core'; import { Forbidden } from '@curveball/http-errors'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; import csv from '../formats/csv'; import * as logService from '../service'; diff --git a/src/login/controller/login.ts b/src/login/controller/login.ts index af6864dd..63555d8b 100644 --- a/src/login/controller/login.ts +++ b/src/login/controller/login.ts @@ -7,7 +7,7 @@ import { EventType } from '../../log/types'; import { MFALoginSession } from '../../mfa/types'; import * as webAuthnService from '../../mfa/webauthn/service'; import { getSetting } from '../../server-settings'; -import { hasUsers, PrincipalService } from '../../principal/privileged-service'; +import { hasUsers, PrincipalService } from '../../principal/service'; import * as userService from '../../user/service'; import { User } from '../../types'; import { isValidRedirect } from '../utilities'; diff --git a/src/oauth2-client/controller/collection.ts b/src/oauth2-client/controller/collection.ts index 3d4ad871..ec99ab1d 100644 --- a/src/oauth2-client/controller/collection.ts +++ b/src/oauth2-client/controller/collection.ts @@ -4,7 +4,7 @@ import { Context } from '@curveball/core'; import { Forbidden, UnprocessableEntity } from '@curveball/http-errors'; import * as hal from '../formats/hal'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; import { GrantType } from '../../types'; import { OAuth2Client } from '../types'; import { findByApp, create } from '../service'; diff --git a/src/oauth2-client/controller/edit.ts b/src/oauth2-client/controller/edit.ts index 7cd7e371..81aa9a09 100644 --- a/src/oauth2-client/controller/edit.ts +++ b/src/oauth2-client/controller/edit.ts @@ -2,7 +2,7 @@ import Controller from '@curveball/controller'; import { Context } from '@curveball/core'; import * as hal from '../formats/hal'; import { Forbidden, NotFound, UnprocessableEntity } from '@curveball/http-errors'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; import { findByClientId, edit } from '../service'; import * as oauth2Service from '../../oauth2/service'; import { GrantType } from '../../types'; diff --git a/src/oauth2-client/controller/item.ts b/src/oauth2-client/controller/item.ts index c920a13b..78e62255 100644 --- a/src/oauth2-client/controller/item.ts +++ b/src/oauth2-client/controller/item.ts @@ -3,7 +3,7 @@ import { Context } from '@curveball/core'; import * as hal from '../formats/hal'; import { Forbidden, NotFound } from '@curveball/http-errors'; import { findByClientId } from '../service'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; import * as oauth2Service from '../../oauth2/service'; class ClientController extends Controller { diff --git a/src/oauth2-client/controller/new.ts b/src/oauth2-client/controller/new.ts index 38486a45..9067dbb9 100644 --- a/src/oauth2-client/controller/new.ts +++ b/src/oauth2-client/controller/new.ts @@ -2,7 +2,7 @@ import Controller from '@curveball/controller'; import { Context } from '@curveball/core'; import * as siren from '../formats/siren'; import { Forbidden } from '@curveball/http-errors'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; class NewClientController extends Controller { diff --git a/src/oauth2-client/service.ts b/src/oauth2-client/service.ts index cffd7ba4..11abb28f 100644 --- a/src/oauth2-client/service.ts +++ b/src/oauth2-client/service.ts @@ -5,7 +5,7 @@ import { Oauth2ClientsRecord } from 'knex/types/tables'; import { wrapError, UniqueViolationError } from 'db-errors'; import { OAuth2Client } from './types'; -import { PrincipalService } from '../principal/privileged-service'; +import { PrincipalService } from '../principal/service'; import db, { insertAndGetId } from '../database'; import { InvalidRequest } from '../oauth2/errors'; import parseBasicAuth from './parse-basic-auth'; diff --git a/src/oauth2/controller/active-sessions.ts b/src/oauth2/controller/active-sessions.ts index 079edbf9..e7a26ba3 100644 --- a/src/oauth2/controller/active-sessions.ts +++ b/src/oauth2/controller/active-sessions.ts @@ -4,7 +4,7 @@ import { Forbidden, NotFound, NotImplemented } from '@curveball/http-errors'; import * as csv from '../formats/csv'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; import * as oauth2Service from '../service'; import * as oauth2ClientService from '../../oauth2-client/service'; diff --git a/src/oauth2/controller/token.ts b/src/oauth2/controller/token.ts index 7adbca01..129cac29 100644 --- a/src/oauth2/controller/token.ts +++ b/src/oauth2/controller/token.ts @@ -2,7 +2,7 @@ import Controller from '@curveball/controller'; import { Context } from '@curveball/core'; import log from '../../log/service'; import { EventType } from '../../log/types'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; import * as userService from '../../user/service'; import { User } from '../../types'; import { InvalidGrant, InvalidRequest, UnsupportedGrantType } from '../errors'; diff --git a/src/oauth2/controller/user-access-token.ts b/src/oauth2/controller/user-access-token.ts index a2cc2d9c..b4e99d7e 100644 --- a/src/oauth2/controller/user-access-token.ts +++ b/src/oauth2/controller/user-access-token.ts @@ -4,7 +4,7 @@ import { Forbidden } from '@curveball/http-errors'; import log from '../../log/service'; import { EventType } from '../../log/types'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; import * as oauth2Service from '../service'; class UserAccessTokenController extends Controller { diff --git a/src/oauth2/service.ts b/src/oauth2/service.ts index e4b7f362..a3808db5 100644 --- a/src/oauth2/service.ts +++ b/src/oauth2/service.ts @@ -3,7 +3,7 @@ import * as crypto from 'crypto'; import db, { query } from '../database'; import { getSetting } from '../server-settings'; -import { PrincipalService } from '../principal/privileged-service'; +import { PrincipalService } from '../principal/service'; import { InvalidGrant, InvalidRequest, UnauthorizedClient } from './errors'; import { CodeChallengeMethod, OAuth2Code, OAuth2Token } from './types'; import { OAuth2Client } from '../oauth2-client/types'; diff --git a/src/one-time-token/controller/exchange.ts b/src/one-time-token/controller/exchange.ts index 5dc92cb3..a06e4b95 100644 --- a/src/one-time-token/controller/exchange.ts +++ b/src/one-time-token/controller/exchange.ts @@ -8,7 +8,7 @@ import { tokenResponse } from '../../oauth2/formats/json'; import * as tokenService from '../service'; import * as oauth2Service from '../../oauth2/service'; import * as oauth2ClientService from '../../oauth2-client/service'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; type OtteRequest = { activateUser?: boolean; diff --git a/src/one-time-token/controller/generate.ts b/src/one-time-token/controller/generate.ts index 18cac2a9..1762f8ab 100644 --- a/src/one-time-token/controller/generate.ts +++ b/src/one-time-token/controller/generate.ts @@ -1,6 +1,6 @@ import Controller from '@curveball/controller'; import { Context } from '@curveball/core'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; import { createToken } from '../service'; import * as hal from '../formats/hal'; import { resolve } from 'url'; diff --git a/src/one-time-token/service.ts b/src/one-time-token/service.ts index 72ca1f07..e0ed7197 100644 --- a/src/one-time-token/service.ts +++ b/src/one-time-token/service.ts @@ -1,7 +1,7 @@ import { OneTimeToken } from './types'; import { User } from '../types'; import db from '../database'; -import { PrincipalService } from '../principal/privileged-service'; +import { PrincipalService } from '../principal/service'; import { BadRequest } from '@curveball/http-errors'; import { generateSecretToken } from '../crypto'; diff --git a/src/principal/privileged-service.ts b/src/principal/service.ts similarity index 100% rename from src/principal/privileged-service.ts rename to src/principal/service.ts diff --git a/src/privilege/service.ts b/src/privilege/service.ts index 33442ca7..74900d66 100644 --- a/src/privilege/service.ts +++ b/src/privilege/service.ts @@ -3,7 +3,7 @@ import db, { query } from '../database'; import { Principal } from '../types'; import { Privilege, PrivilegeMap, PrivilegeEntry } from './types'; import { UserPrivilegesRecord } from 'knex/types/tables'; -import { PrincipalService } from '../principal/privileged-service'; +import { PrincipalService } from '../principal/service'; import { Forbidden } from '@curveball/http-errors'; diff --git a/src/register/controller/user.ts b/src/register/controller/user.ts index 0e6941d0..ed2eb637 100644 --- a/src/register/controller/user.ts +++ b/src/register/controller/user.ts @@ -2,7 +2,7 @@ import Controller from '@curveball/controller'; import { Context } from '@curveball/core'; import { Forbidden, NotFound } from '@curveball/http-errors'; import { getSetting } from '../../server-settings'; -import { PrincipalService, hasUsers } from '../../principal/privileged-service'; +import { PrincipalService, hasUsers } from '../../principal/service'; import * as userService from '../../user/service'; import { registrationForm } from '../formats/html'; import * as privilegeService from '../../privilege/service'; diff --git a/src/reset-password/controller/request.ts b/src/reset-password/controller/request.ts index c6ef1a6d..6929c1a5 100644 --- a/src/reset-password/controller/request.ts +++ b/src/reset-password/controller/request.ts @@ -3,7 +3,7 @@ import { Context } from '@curveball/core'; import { NotFound, BadRequest } from '@curveball/http-errors'; import log from '../../log/service'; import { EventType } from '../../log/types'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; import { resetPasswordRequestForm } from '../formats/html'; import { sendResetPasswordEmail } from '../service'; diff --git a/src/user-app-permissions/controller/user-collection.ts b/src/user-app-permissions/controller/user-collection.ts index c63b38bd..41338adb 100644 --- a/src/user-app-permissions/controller/user-collection.ts +++ b/src/user-app-permissions/controller/user-collection.ts @@ -2,7 +2,7 @@ import Controller from '@curveball/controller'; import { Context } from '@curveball/core'; import * as hal from '../formats/hal'; import * as userAppPermissionService from '../service'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; class UserAppPermissionsCollection extends Controller { diff --git a/src/user-app-permissions/controller/user-item.ts b/src/user-app-permissions/controller/user-item.ts index 6ee7ac6d..5c829795 100644 --- a/src/user-app-permissions/controller/user-item.ts +++ b/src/user-app-permissions/controller/user-item.ts @@ -2,7 +2,7 @@ import Controller from '@curveball/controller'; import { Context } from '@curveball/core'; import * as hal from '../formats/hal'; import { Forbidden } from '@curveball/http-errors'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; import * as userAppPermissionService from '../service'; class UserAppPermissionsItem extends Controller { diff --git a/src/user-app-permissions/service.ts b/src/user-app-permissions/service.ts index ccc3a2e8..e0b5e71b 100644 --- a/src/user-app-permissions/service.ts +++ b/src/user-app-permissions/service.ts @@ -1,7 +1,7 @@ import db from '../database'; import { App, User } from '../types'; import { UserAppPermission } from './types'; -import { PrincipalService } from '../principal/privileged-service'; +import { PrincipalService } from '../principal/service'; import { UserAppPermissionsRecord } from 'knex/types/tables'; import { NotFound } from '@curveball/http-errors'; diff --git a/src/user/controller/by-href.ts b/src/user/controller/by-href.ts index 9c02bcf8..0da374ed 100644 --- a/src/user/controller/by-href.ts +++ b/src/user/controller/by-href.ts @@ -1,6 +1,6 @@ import Controller from '@curveball/controller'; import { Context } from '@curveball/core'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; class UserByHrefController extends Controller { diff --git a/src/user/controller/collection.ts b/src/user/controller/collection.ts index c32d1d6b..fe526b52 100644 --- a/src/user/controller/collection.ts +++ b/src/user/controller/collection.ts @@ -2,7 +2,7 @@ import Controller from '@curveball/controller'; import { Context } from '@curveball/core'; import { BadRequest, Conflict, NotFound } from '@curveball/http-errors'; import * as hal from '../formats/hal'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; type NewPrincipalBody = { nickname: string; diff --git a/src/user/controller/edit.ts b/src/user/controller/edit.ts index 6fb7fa9b..62471694 100644 --- a/src/user/controller/edit.ts +++ b/src/user/controller/edit.ts @@ -1,7 +1,7 @@ import Controller from '@curveball/controller'; import { Context } from '@curveball/core'; import * as hal from '../formats/hal'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; class UserEditController extends Controller { diff --git a/src/user/controller/item.ts b/src/user/controller/item.ts index b0290e1d..36f8c5f5 100644 --- a/src/user/controller/item.ts +++ b/src/user/controller/item.ts @@ -5,7 +5,7 @@ import * as userHal from '../formats/hal'; import * as appHal from '../../app/formats/hal'; import * as groupHal from '../../group/formats/hal'; import * as userService from '../service'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; type EditPrincipalBody = { nickname: string; diff --git a/src/user/controller/new.ts b/src/user/controller/new.ts index fcb6d2f1..cb155190 100644 --- a/src/user/controller/new.ts +++ b/src/user/controller/new.ts @@ -1,7 +1,7 @@ import Controller from '@curveball/controller'; import { Context } from '@curveball/core'; import { NotFound, UnprocessableEntity } from '@curveball/http-errors'; -import { PrincipalService, isIdentityValid } from '../../principal/privileged-service'; +import { PrincipalService, isIdentityValid } from '../../principal/service'; import { createUserForm } from '../formats/html'; type UserNewForm = { diff --git a/src/user/controller/password.ts b/src/user/controller/password.ts index bccb7b23..843a7982 100644 --- a/src/user/controller/password.ts +++ b/src/user/controller/password.ts @@ -1,6 +1,6 @@ import Controller from '@curveball/controller'; import { Context } from '@curveball/core'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; import * as userService from '../service'; class UserPasswordController extends Controller { diff --git a/src/user/controller/privileges.ts b/src/user/controller/privileges.ts index 7a81a9d8..fb61f062 100644 --- a/src/user/controller/privileges.ts +++ b/src/user/controller/privileges.ts @@ -4,7 +4,7 @@ import { BadRequest } from '@curveball/http-errors'; import * as privilegeService from '../../privilege/service'; import { PrivilegeMap } from '../../privilege/types'; import * as hal from '../formats/hal'; -import { PrincipalService } from '../../principal/privileged-service'; +import { PrincipalService } from '../../principal/service'; // import * as groupService from '../../group/service'; type PolicyForm = {