Commit Graph

42 Commits

Author SHA1 Message Date
MT Lewis 3bb0afb54c permission-node: add test for apply conditions router
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2022-01-13 13:04:30 +00:00
MT Lewis 34a4be296f permission-node: list all incorrect resource types in apply-conditions handler
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2022-01-13 13:04:06 +00:00
MT Lewis 1fb2e0e0b4 permission-node: wrap request and response arrays in object
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2022-01-13 13:04:06 +00:00
MT Lewis cbb85e07f0 permission-node: simplify undefined check and fix applyConditions signature
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2022-01-13 13:04:05 +00:00
MT Lewis 8e72b573aa permission-node: switch to array for getResources return value
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2022-01-13 13:04:04 +00:00
MT Lewis 706b6c29e9 permission-node: allow batch retrieval of resources in /apply-conditions
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2022-01-13 13:04:04 +00:00
MT Lewis b66704db18 permission-node: accept batched requests in /apply-conditions
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2022-01-13 13:04:03 +00:00
MT Lewis 9db1b86f32 permission-node: add helpers for creating PermissionRules
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2022-01-07 16:06:58 +00:00
MT Lewis bc9a205b86 backend-common: remove isSecure property in favour of a property on the NoopServerTokenManager
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2021-12-21 10:04:04 +00:00
MT Lewis 20d10b57d6 permission-node: rename static create method to fromConfig
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2021-12-21 09:46:22 +00:00
MT Lewis c829631b4a permission-node: use filename import in ServerPermissionClient test suite
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2021-12-20 17:34:25 +00:00
Joon Park f898c014ca Add explicit instance variable to denote the given token manager's scope of authentication
Signed-off-by: Joon Park <joonp@spotify.com>
2021-12-17 18:52:36 +00:00
Joon Park 0e8ec6d974 Rename all the things
Signed-off-by: Joon Park <joonp@spotify.com>
2021-12-17 18:16:47 +00:00
Joon Park d1801d7166 Refactor ServerPermissionClient away from inheritance
Signed-off-by: Joon Park <joonp@spotify.com>
2021-12-17 18:16:47 +00:00
Joon Park 816e0e04f9 Address various comments round 1
Signed-off-by: Joon Park <joonp@spotify.com>
2021-12-17 18:16:47 +00:00
Joon Park 24dce3ca43 Reintroduce noop token manager and refactor ServerPermissionClient
Signed-off-by: Joon Park <joonp@spotify.com>
2021-12-17 18:16:47 +00:00
Joon Park abb7616345 Add changeset and docs.
Signed-off-by: Joon Park <joonp@spotify.com>
2021-12-17 18:16:46 +00:00
Joon Park 6b8713df35 Create ServerPermissionClient and add it to example backend
Signed-off-by: Joon Park <joonp@spotify.com>
2021-12-17 18:16:46 +00:00
Johan Haals dd77b5eb12 Merge pull request #8283 from backstage/mob/identity-api
core-plugin-api: stabilize IdentityApi
2021-12-08 14:29:03 +01:00
Fredrik Adelöw dcd1a0c3f4 Do not unpack arguments directly on exported items
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-12-07 19:42:10 +01:00
Johan Haals 8c337a480f chore: Update types and API reports
Signed-off-by: Johan Haals <johan.haals@gmail.com>
2021-12-02 13:32:35 +01:00
MT Lewis 450ca92330 permissions: change permission integration route to use /.well-known prefix
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2021-12-01 15:52:08 +00:00
MT Lewis 8c6f4810c9 permission-node: fix test suite name
Co-authored-by: Joe Porpeglia <porpegliaj@gmail.com>
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2021-11-30 15:58:47 +00:00
MT Lewis e7851efa9e permission-node: rename and adjust policy return type to reduce nesting
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2021-11-30 15:21:28 +00:00
Mike Lewis 370da15e7b permission-node: separate doc comment summaries with @remarks tag
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-24 14:30:21 +00:00
Mike Lewis f5a25ec804 permission-node: fix typo in doc comment
Co-authored-by: Fredrik Adelöw <freben@gmail.com>
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-24 14:19:59 +00:00
Mike Lewis b08dbb1035 permission-node: destructure options inside function to simplify api-report
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-24 14:18:11 +00:00
Mike Lewis 5bff67aac4 permission-node: expose ApplyConditionsResponse type
This type will be shared with the backend.

Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-22 15:37:36 +00:00
Mike Lewis 3254303a96 permission-node: refactor and split createPermissionIntegration
This refactor makes the createPermissionIntegration system much more
flexible by splitting it up into a few different helpers with different
responsibilities. This frees up plugin authors to connect together the
different parts of the permission integration in whatever way is
convenient for them, and makes the process of registering additional
permission rules a bit more explicit, by requiring them to be passed
in when constructing the systems for transforming or applying
conditions.

Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
Co-authored-by: Joon Park <joonp@spotify.com>
Co-authored-by: Tim Hansen <timbonicus@gmail.com>
2021-11-22 15:37:35 +00:00
Mike Lewis 0eb339c3a4 permission-node: more visible condition transform in mapCriteria test
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-22 15:37:35 +00:00
Tim Hansen 27d5f5fed3 Improve api-report
Signed-off-by: Tim Hansen <timbonicus@gmail.com>
2021-11-22 15:37:35 +00:00
Mike Lewis 5c5a1d16e4 authz: remove superfluous union type
PermissionCriteria<TQuery> is a union type which already includes
TQuery itself, so we don't need a second union here.

Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-22 15:37:35 +00:00
Mike Lewis e2088541dd authz: update references to permission-common after move to plugins
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-22 15:37:34 +00:00
Mike Lewis f72d7bba0e authz: add testsuite for createPermissionIntegration
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-22 15:37:34 +00:00
Mike Lewis 5c75c89106 authz: improve error handling in permission-node apply-conditions route
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-22 15:37:34 +00:00
Mike Lewis 22f5de9840 authz: update createPermissionIntegration to work with new PermissionCriteria type
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-22 15:37:34 +00:00
Mike Lewis 64b6ff368f authz: fix expected response type for /apply-conditions route
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-22 15:37:33 +00:00
Mike Lewis 652af0834a authz: add test suite for conditionFor
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-22 15:37:33 +00:00
Mike Lewis f3d2ccfeb8 authz: switch to unknown[] in PermissionRule type parameter
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-22 15:37:33 +00:00
Mike Lewis 4083fcdb5e authz: fix PermissionCondition type parameter
`unknown` doesn't satisfy the (recently added) `extends unknown[]`
constraint. In these two cases, we can remove the parameter entirely and
rely instead on the default of `unknown[]`.

Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-22 15:37:33 +00:00
Mike Lewis a82709c38f authz: update unused type params in conditionFor to unknown
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-22 15:37:33 +00:00
Tim Hansen a1e2972dda Add permission-node package
Signed-off-by: Tim Hansen <timbonicus@gmail.com>
Co-authored-by: Mike Lewis <mtlewis@users.noreply.github.com>
Co-authored-by: Himanshu Mishra <himanshu@orkohunter.net>
Co-authored-by: Joe Porpeglia <joeporpeglia@users.noreply.github.com>
Co-authored-by: Vincenzo Scamporlino <vinzscam@users.noreply.github.com>
2021-11-22 15:37:32 +00:00