Commit Graph

19467 Commits

Author SHA1 Message Date
Patrik Oldsberg bd3ae04de9 cli: fixes for common package factory
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-13 15:47:29 +01:00
Patrik Oldsberg 069934c627 cli: some more docs for create types
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-13 15:47:29 +01:00
Patrik Oldsberg 6a46eb2693 cli: refactor inquirer prompt message transforms for clarity
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-13 15:47:29 +01:00
Patrik Oldsberg 16d06f6ac3 changesets: add changeset for CLI create command
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-13 15:47:29 +01:00
Patrik Oldsberg 9bbc2da04e docs/local-dev: add cli create command docs
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-13 15:47:28 +01:00
Patrik Oldsberg 823a097b3b cli: use common testing utils for create factory tests
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-13 15:47:28 +01:00
Patrik Oldsberg 7b8f19492e cli: add test for plugin package template execution + fix
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-13 15:47:28 +01:00
Patrik Oldsberg 8c83ce8084 cli: leave initial create logging to the factories
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-13 15:47:28 +01:00
Patrik Oldsberg 1c291cb66f package.json: add backstage-create script
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-13 15:47:27 +01:00
Patrik Oldsberg a9f8363b5d cli: format package.json after creation to simplify template
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-13 15:47:27 +01:00
Patrik Oldsberg 827fb840b4 cli: fix for create crashing if no scope is specified
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-13 15:47:27 +01:00
Patrik Oldsberg 8f2a718438 cli: added create factory and template for plugin common package
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-13 15:47:27 +01:00
Fredrik Adelöw af855da49f Merge pull request #8037 from backstage/rugvip/issuefix
scripts: tweak snyk issue script to catch existing license issues
2021-11-13 08:01:18 +01:00
Patrik Oldsberg dd75158865 scripts: tweak snyk script to match license issues
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-12 21:42:40 +01:00
Patrik Oldsberg 46a161a023 scripts: make snyk issue script executable
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-12 21:35:40 +01:00
Zach Falen 7d6ab03ebb update test
Signed-off-by: Zach Falen <zfalen@deloitte.com>
2021-11-12 13:32:48 -07:00
Zach Falen 892c1d9202 add changeset
Signed-off-by: Zach Falen <zfalen@deloitte.com>
2021-11-12 12:56:33 -07:00
Zach Falen 8a60033962 hotfix for Backstage token generation, prefer .token over .idToken
Signed-off-by: Zach Falen <zfalen@deloitte.com>
2021-11-12 12:53:13 -07:00
Andre Wanlin 48fe020c05 Updated to handle dates nicely with tests
Signed-off-by: Andre Wanlin <awanlin@rapidrtc.com>
2021-11-12 13:52:29 -06:00
Andre Wanlin 70b96a8d65 Merge branch 'backstage:master' into topic/add-entity-pull-requests 2021-11-12 13:25:26 -06:00
Patrik Oldsberg 1cf00cbe33 cli: added test for backendPlugin create factory
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-12 18:19:33 +01:00
Patrik Oldsberg 033f6abfce cli: add tests for frontendPlugin create factory + minor fixes
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-12 18:15:03 +01:00
Tim Jacomb 26eb174ce8 Skip empty file names during scaffolder
Signed-off-by: Tim Jacomb <tim.jacomb@hmcts.net>
2021-11-12 16:02:50 +00:00
Patrik Oldsberg 367e09e31f cli: refactor to simplify codeowners logic
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-12 16:47:22 +01:00
Patrik Oldsberg 0ebcf168d2 cli: common helper for executing plugin package templates
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-12 16:47:22 +01:00
Mike Lewis 06934f2f52 catalog-backend: ensure subqueries are isolated from one another
Ensures that independent calls to `parseFilter` are isolated from one
another, by always wrapping additional clauses to the query in
`andWhere`. I think that the bug in the previous incarnation is strictly
theoretical, as long as parseFilters is only called once for a given
filter (which today, it is). When authorization lands in catalog-backend
though, we'll need to call it multiple times - once to add the authz
filters, and once to add the filters requested by the caller, which
would expose this bug.

Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-12 15:45:11 +00:00
Patrik Oldsberg 142cd41b7e cli: refactor create factories to use common prompts
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-12 16:24:41 +01:00
Patrik Oldsberg 1c0ac6291c cli: added create backend plugin factory
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-12 16:24:41 +01:00
Ben Lambert d0ea59bee8 Merge pull request #7998 from awanlin/topic/improve-azure-devops-date-handling
Improved Azure DevOps Date Handling
2021-11-12 16:02:49 +01:00
Patrik Oldsberg 7b8d432de5 cli: complete frontendPlugin create factory implementation
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-12 15:54:02 +01:00
Patrik Oldsberg 248c8eaa25 cli: allow empty create option values
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-12 15:33:45 +01:00
Patrik Oldsberg 602cf4d80d cli: run templating tasks in strict mode
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-12 15:24:08 +01:00
Patrik Oldsberg f8adebde77 cli: build out task lib a bit with command execution, adding deps
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-12 15:23:32 +01:00
Patrik Oldsberg e04cce9cdb cli: wrap create factories up in a bit more built-in logging
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-12 15:22:11 +01:00
Mike Lewis e84abaccaf authz: move permission-common to plugins
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-12 14:18:10 +00:00
Mike Lewis f816f68bbe authz: add PermissionClient TODO for better type-safety
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-12 14:18:10 +00:00
Mike Lewis f0124d29a9 authz: use zod to validate responses in PermissionClient
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-12 14:18:10 +00:00
Mike Lewis 0c0cf0ddaf build(deps): add dependency on zod in permission-common
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-12 14:18:06 +00:00
Mike Lewis 20d3ef45e2 authz: further relaxation of PermissionCriteria type
The PermissionCriteria type is actually intended to be the type used to
represent criteria for arbitrary queries, whether they are expressed as
PermissionConditions or plugin-specific query fragments. As such we
don't need to refer to the PermissionCondition type at all - we can
stick with the TQuery type parameter as the type for the unwrapped
query fragment.

Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-12 14:17:16 +00:00
Mike Lewis ea77555fe3 authz: restrict type of PermissionCondition params
We need a guarantee that we'll be able to spread permission condition
params when applying the condition via the `apply` or `toQuery` methods
on the corresponding rule. As such, we need to enforce that the TParams
type parameter is an array.

This commit also supplies a default value of unknown[] for this type
param to make it a bit more convenient to use the type in situations
where the type of the params is not important.

Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-12 14:17:16 +00:00
Mike Lewis 00448f02e6 authz: fix PermissionCondition type parameter
The type parameter for PermissionCondition refers to the type of the
condition params, not the type of the leaf entries in a
PermissionCriteria object.

It should be safe to always set this type parameter to `unknown[]` in
this case. Each PermissionCondition is will have different parameters,
therefore we just need to enforce that the params is always an array of
unknown.

Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-12 14:17:16 +00:00
Mike Lewis 59702b2bde authz: do not export AuthorizeResult as type
Since AuthorizeResult is an enum, exporting it via `export type` is
incorrect - it means we can refer to the AuthorizeResult type, but not
use it or its members as values.

Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-12 14:17:16 +00:00
Tim Hansen dce7237d46 PermissionCriteria generic
Signed-off-by: Tim Hansen <timbonicus@gmail.com>
2021-11-12 14:17:15 +00:00
Tim Hansen c00b4d3829 Remove enum, package fixes
Signed-off-by: Tim Hansen <timbonicus@gmail.com>
2021-11-12 14:17:15 +00:00
Tim Hansen e6805978d8 Remove JSON types, add not criteria
Signed-off-by: Tim Hansen <timbonicus@gmail.com>
2021-11-12 14:17:15 +00:00
Tim Hansen 7bba7a8998 Add permission-common package
Signed-off-by: Tim Hansen <timbonicus@gmail.com>
2021-11-12 14:17:14 +00:00
Andre Wanlin 8b5bd7e0d5 Updated changeset to minor for common
Signed-off-by: Andre Wanlin <awanlin@rapidrtc.com>
2021-11-12 08:06:45 -06:00
Greg Bomkamp e605194868 Merge branch 'master' into add-global-pg-plugin-schema-flag 2021-11-12 09:05:15 -05:00
Mike Lewis 6f8e995145 Merge pull request #8023 from backstage/bump-api-documenter
build(deps): bump @microsoft/api-documenter to v7.13.68
2021-11-12 14:04:11 +00:00
Andre Wanlin a06242e5cc Refactored route names
Signed-off-by: Andre Wanlin <awanlin@rapidrtc.com>
2021-11-12 08:03:19 -06:00