storj/private/apigen
Ivan Fraixedes fb31761bad satellite/admin/back-office: Add auth middleware
Create an API generator middleware for being able to hook the new
satellite admin authorization in the endpoints.

The commit fixes a bug found in the API generator that caused that
fields of types of the same package of the generated code where wrongly
added. Concretely:

- The package matching was missing in the function middlewareFields,
  hence it was generating code that referenced types with the package
  name.
- middlewareFields function was not adding the pointer symbol (*) when
  the type was from the same package where the generated code is
  written.

There is also an accidental enhancement in the API generator because I
thought that the bug commented above corresponded to it, rather than
removing it, I though that was worthwhile to keep it because it was
already implemented. This enhancement allows to use fields in the
middleware with packages whose last path part contains `-` or `.`, using
a package rename in the import statement.

Change-Id: Ie98b303226a8e8845e494f25054867f95a283aa0
2023-12-01 00:29:49 +00:00
..
example private/apigen: Inject middleware code after param parsing 2023-11-27 23:02:44 +00:00
common_test.go private/apigen: Avoid clashes of types names 2023-10-05 07:30:09 +00:00
common.go private/apigen: handle omitempty JSON option in structs 2023-11-18 07:09:42 -06:00
docgen.go private/apigen: Don't print empty description & version in docs 2023-11-27 16:53:33 +00:00
endpoint_test.go private/apigen: Add a TypeScript client mock generator 2023-10-25 14:43:01 +02:00
endpoint.go satellite/admin/back-office: Add auth middleware 2023-12-01 00:29:49 +00:00
gogen_test.go private/apigen: Remove support for anonymous types 2023-11-16 12:29:21 +00:00
gogen.go satellite/admin/back-office: Add auth middleware 2023-12-01 00:29:49 +00:00
tsgen.go private/apigen: Allow to customize handlers logic 2023-11-23 06:57:40 +00:00
tsgenmock.go private/apigen: Remove support for anonymous types 2023-11-16 12:29:21 +00:00
tstypes_test.go private/apigen: Remove support for anonymous types 2023-11-16 12:29:21 +00:00
tstypes.go private/apigen: use correct TS type for nillable fields 2023-11-21 17:58:07 +00:00