Skip to content

Floorplan 0.10.0

Latest

Choose a tag to compare

@haydenschmitty haydenschmitty released this 15 Nov 16:46
  • One unusual letter no longer blanks the map: to list the page's own scripts in its Content-Security-Policy, the build reads a lower-cased copy of the page, and a few letters get longer when lower-cased (the Turkish "İ" becomes two characters). One of them anywhere before the scripts, in a comment the scan picked up, a file name or a description, moved every later script by one character in that copy, so their fingerprints were wrong, the browser blocked them and the map drew nothing. Only A to Z are lower-cased now, the way the browser reads tag names, so the copy always lines up with the page. Fixed by @OfficialCodeVoyage in #118.
  • Fastify routes written as objects are found: a Fastify server that declares its endpoints as app.route({ method: 'POST', url: '/api/orders', handler }) had none of them on the map. They now count on any router the file makes (const api = Fastify()), with one endpoint per method when method is a list, and a preHandler, onRequest or preValidation check on the route protects only that route. A key inside the route's schema, and a method or url that isn't written out, don't make an endpoint. Fixed by @Bl0ck154 in #34.
  • NestJS endpoints are on the map: a NestJS server used to show no endpoints at all, so its requests from the website weren't connected and Health couldn't say which endpoints anyone can call. Endpoints now come from @Controller('prefix') (or @Controller({ path })) and the @Get, @Post, @Put, @Patch, @Delete, @All, @Options and @Head decorators on its methods, each with its handler, in files that import @nestjs/common. A file with several controllers, or a controller followed by another class, keeps each endpoint under its own controller and named after its own method. Health reads @UseGuards(...) on a method or its class, a sign-in guard for the whole app ({ provide: APP_GUARD, useClass: AuthGuard } in a module, or app.useGlobalGuards(new JwtAuthGuard()) in main.ts), and the @Public()-style decorators that open a route past it (a public route that checks a token or signature itself still counts as checked). An app-wide guard protects the Nest controllers only, not an Express or Next.js server in the same repo, and rate-limit and quota guards, or one whose name doesn't say what it checks (MaintenanceGuard), don't count as sign-in checks. A global prefix set at run time (app.setGlobalPrefix) isn't seen yet. Fixed by @stefantalos in #111, with the several-controllers fix and sample from @BestShuffle in #82.
  • Endpoints listed as data are found: some servers keep their endpoints in a list a dispatcher reads, like [{ method: "GET", path: "/api/items", handle: listItems }], where the path can be a regular expression (/^\/api\/items\/([^/]+)$/ is /api/items/:p1, and (?:items|products) gives one endpoint for each word), and Bun servers declare theirs in Bun.serve({ routes }). These had no endpoints on the map. Each one is now an endpoint named after its handler, and the website's requests are linked to it. A list of the requests a website makes ({ method, path, action: 'createOrder' }, or resolve and fetch functions) isn't taken for routes: action, resolve and fetch count only in a file that serves or next to entries with a handle, and the value must be a function. A pattern that can't be turned into a clear path is dropped rather than made to match everything. As with route tables keyed by method and path, Health doesn't judge their sign-in, which happens in the dispatcher. Fixed by @maxschuetz06 in #29.
  • Angular routing files are no longer endpoints: under src/app/, a file whose name merely ends in route.ts (Angular's orders.route.ts) was read as a Next.js route handler, so it showed up as a GET endpoint and Health reported a whole Angular app's endpoints as open to anyone. Only a file named exactly route.ts is a Next.js route handler now. Fixed by @BestShuffle in #84.
  • FastAPI routers with a check that takes arguments: a router like APIRouter(dependencies=[Depends(require_workspace("tours"))]), where a check's factory is called with arguments, was read only up to its first ), so its sign-in check was missed and all its routes were reported as open. The whole APIRouter(...) is now read, and a check named just authenticate or authorize counts. A check that only appears in a comment or a string inside it still protects nothing. Fixed by @spacecampkatie in #73.
  • Requests through an app's own helpers are found: calls like apiGet('/tasks'), apiSend('PATCH', `/tasks/${id}`, body) or httpPost('/orders') are now web requests, with the method taken from the helper's name or its first argument. A phone app that made all its calls this way showed almost none. Fixed by @Basel-Alsemsam in #105.
  • A client's base address wins over a closer-looking match: when a client's other calls all go under one base (its base URL holds /api/v2), an address like /tasks/${id} now reaches /api/v2/tasks/:id rather than a website page at /tasks/:id, even when both live in the same server file. A base is only learned from calls that every equally good match agrees on, so one ambiguous call can't teach the wrong one, and a base one app teaches is shared only with that app's own files (the folder with its package.json, or its repo), never with another app beside it. Fixed by @Basel-Alsemsam in #105.
  • Requests built by a service method: an Angular service (or any class) that builds its addresses in a method, like this.http.post(this.url(id, '/ship'), {}) with url() returning a template string, now has those requests on the map, including methods that build on another one (itemUrl() calling url()). Before, they were missed or matched to the wrong endpoint from their last piece alone (/ship). Fixed by @BestShuffle in #83.
  • Requests whose address is on the next line: this.http.patch<Order>( with the address on the line below now counts, with its method. Before, such a request was only found when its address happened to contain a word like api or base. Fixed by @BestShuffle in #83.
  • Swift apps get their connections: Swift files showed no links at all, because a Swift import names a module rather than a file, and files of one module use each other's code without importing anything. Floorplan now reads every Package.swift to find each target's folder (its path:, or Sources/<name> and Tests/<name>), and links a file to the files declaring the types, type aliases, functions and values it uses, in its own module and in the modules it imports (including @testable import). An Xcode app with no package counts as one module, so its folders link to each other too. Nested and private declarations are left out, so common names like Kind or State don't link unrelated files, a name the file's own module declares wins over the same name in a module it imports, only tests link to test helpers, and a module the file imports but uses nothing visible from (only its extensions, say) gets no link rather than one picked at random. Apple's frameworks are left off the map, other packages (like Sparkle) show up as outside packages, and classes, structs, enums, protocols and actors are listed on each file's card, protocols and actors with the type icon. Contributed by @JohannDesobry in #79.
  • Shopify themes are mapped: a theme's Liquid files weren't read at all, so its map had almost nothing on it. Now a folder with a layout/theme.liquid is read as a theme, and its files are linked the way Shopify loads them, by name: {% render %} to snippets, {% section %} and {% sections %} to sections and section groups, {% content_for 'block' %} to theme blocks and asset_url to assets. JSON templates and section groups use the sections and theme blocks they list, including Liquid typed into custom-code settings. Apps added as app blocks or embeds show up as outside packages (shopify-app:<app>), each template is a page on the Screens list (alternate templates opened with ?view=), snippets and sections show their {% doc %} or comment descriptions and their schema's blocks, and Health lists snippets nothing renders or names. A theme's Liquid files and JSON templates count as code, so they're on the map and no longer under NOT MAPPED; .liquid files outside a theme (Jekyll, Eleventy) are left as before. Asked for by @turbo-42 in #80 and added by them in #81.
  • ASP.NET Core backends are mapped: Floorplan found no endpoints in a C# backend, so a website and its ASP.NET Core API showed up as two islands with nothing between them. Now controller actions ([Route], [HttpGet] and the other verbs, with [controller], [action] and [area] filled in), actions a controller inherits from a base controller, controllers reached through MapControllerRoute, minimal APIs (app.MapGet(…) under their MapGroup prefixes, also when they're mapped in a method of their own) and SignalR hubs are endpoints, each named and described from its <summary>. The website's requests reach them whatever their upper and lower case, as ASP.NET Core routes do (/api/orders finds OrdersController); other frameworks still match exactly. Endpoints in a .NET test project (Orders.Api.Tests/) stay off the map. Reported by @Joren-vanGoethem in #27 and fixed by them in #28.
  • C# files are connected: a using links a file to the files of that namespace that declare a type it uses, so one using doesn't link a whole namespace, and a global using counts across its project (the folder of its .csproj). System and Microsoft.AspNetCore count as built in, and other namespaces show as NuGet packages. Fixed by @Joren-vanGoethem in #28.
  • Health checks ASP.NET Core apps: it reports endpoints anyone can use, reading [Authorize] and [AllowAnonymous] on the action, its controller or a base controller however many classes up, attributes of your own built on AuthorizeAttribute, .RequireAuthorization() and .AllowAnonymous() on an endpoint or its group, a handler that checks the caller itself (also one in another file), and an app-wide fallback policy, which covers only its own project, so one service's policy can't hide another's open endpoints. [AllowAnonymous] means public on purpose and isn't reported. It also finds CORS that lets every website call the server, Stripe webhooks that never check Stripe's signature (with fix steps written for ASP.NET Core), and a database password inside a .NET connection string (Server=…;Password=…), leaving alone this computer, variables, placeholders and made-up values, as for other secrets. Fixed by @Joren-vanGoethem in #28.
  • PHP and Laravel apps get a real map: a Laravel app showed no endpoints, and its PHP files no connections, because Floorplan only followed require. Reported by @epistex-dev in #67, fixed by @Basel-Alsemsam in #106. Now:
    • PHP files link to the classes they use: use statements (grouped and aliased ones too), traits, and classes named without one (new Order, Order::class, parameter types, extends), found by namespace and through composer.json's PSR-4 folders. Outside packages are named by vendor (composer:Illuminate). PHP is read, never run.
    • Laravel endpoints with their full address: Route::get/post/…, match, resource and apiResource (with only/except), Route::view and Route::inertia, under prefix, name, middleware and controller groups. A route file loaded inside a group (require, ->group(base_path(…)), files required in a loop over a fixed list, withRouting in bootstrap/app.php) gets the group's prefix, name and middleware.
    • Each endpoint sits in the controller method that answers it, with that method's doc comment, so requests lead to the code that handles them rather than to the routes file.
    • Laravel Wayfinder calls (import { show } from '@/routes/orders', OrderController.update.form(…)) reach their endpoints by route name or controller method, though Wayfinder's generated files aren't in git. A name defined twice is left unlinked rather than guessed.
    • Inertia pages are screens: a controller method that renders a page makes it a screen at the endpoint's address, with the controller and its data behind it.
    • Health checks who may call each Laravel endpoint: middleware on the route, its groups and the route files around it (through the app's own aliases and groups), the controller's own middleware, a form request whose authorize() looks at the user, and checks inside the method ($this->authorize, Gate::, abort_unless(…, 403)). Sign-in pages (guest), closures that only redirect or answer something fixed, and plain pages aren't reported. Each open endpoint's fix names the file it's registered in.
    • The scan says what it found: a LARAVEL line with the endpoints, the route files they come from, the Wayfinder calls and Inertia pages linked, and any route file nothing loads, and --json counts the links as wayfinderLinks and inertiaPages.
  • Privacy, terms and legal pages are public on purpose: Health no longer reports reading a site's /privacy, /privacy-policy, /terms, /terms-of-service, /tos, /legal or imprint page as open to anyone. Only reading counts, and only when the whole address is the page (/legal/imprint too), so someone's privacy settings (/account/privacy), data under a legal address (/api/legal/cases), a request like /api/privacy-requests and a change to one of those pages are still checked. Fixed by @Basel-Alsemsam in #106.
  • Health notices PHP that answers requests itself: What was checked stood out when JavaScript, Python or Go code looked like it ran a server but no endpoints were found, and said nothing special about PHP. Now PHP that reads the request itself ($_POST, $_GET, $_SERVER['REQUEST_METHOD']) or declares routes Floorplan doesn't read yet (Symfony's #[Route], Slim's $app->get('/…')) makes that line stand out too, naming the file. A mention in a comment or a string, a Blade template, a test, or a container's $app->get('config') doesn't count.

Update with claude plugin update floorplan@floorplan.