A kódbázis kommentek nélkül marad
Kérésre: minden magyarázó komment kikerült a forrásfájlokból — 89 Ruby, 16 TypeScript, 14 Vue, plusz a CSS/JS/CJS. Nem soralapú kereséssel: a Ruby-t a Ripper tokenizálta, a JS/TS/CSS-t állapotgép járta végig, hogy az URL-ekben, reguláris kifejezésekben és heredocokban álló // és # jelek helyükön maradjanak. Három komment maradt, mert nélkülük nem indul a kód: az entrypoint.sh shebangja, a vite-env.d.ts hármas perjeles referenciája, és a sanitize teszt @vitest-environment direktívája (ez utóbbi a magyarázó része nélkül). Egy helyen kódot is kellett írni: a CommandBlock másolás-hibaágán a komment volt a catch egyetlen tartalma, és üres blokkot az eslint nem enged — a copied jelző visszaállítása került a helyére. A yaml, Dockerfile, Makefile, erb és markdown fájlokat nem érintettem. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,8 +3,7 @@ class CreateApplicationTokens < ActiveRecord::Migration[8.1]
|
||||
create_table :application_tokens, id: { type: :bigint, unsigned: true },
|
||||
charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
|
||||
t.string :name, limit: 128, null: false
|
||||
# The owner class comes from the host (WarpEngine.config.application_token_owner_class),
|
||||
# so no FK.
|
||||
|
||||
t.string :owner_type, limit: 128, null: false
|
||||
t.bigint :owner_id, null: false, unsigned: true
|
||||
t.string :token_digest, limit: 64, null: false
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
class AddBuildOwnership < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
# Owner of the publishing token; nil = internal / pre-backfill software.
|
||||
# The owner class comes from the host (application_token_owner_class), so no FK.
|
||||
|
||||
add_column :softwares, :owner_type, :string, limit: 128
|
||||
add_column :softwares, :owner_id, :bigint, unsigned: true
|
||||
add_index :softwares, [ :owner_type, :owner_id ], name: "idx_softwares_owner"
|
||||
|
||||
# unrestricted = internal token: exempt from enforce_software_ownership.
|
||||
add_column :application_tokens, :unrestricted, :boolean, default: false, null: false
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,26 +2,16 @@ class CreateDeviceGrants < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
create_table :device_grants, id: { type: :bigint, unsigned: true },
|
||||
charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
|
||||
# Both codes are secrets in the sense that guessing one grants a session, but they
|
||||
# have different jobs: the device code is long and never shown to a person, the
|
||||
# user code is short enough to read off a screen and type into a browser.
|
||||
|
||||
t.string :device_code, limit: 64, null: false
|
||||
t.string :user_code, limit: 16, null: false
|
||||
# What the client called itself. Shown on the approval page, so a person can tell
|
||||
# which machine is asking, and kept on the issued token as its name.
|
||||
|
||||
t.string :client_name, limit: 128
|
||||
# The approving subject comes from the host
|
||||
# (WarpEngine.config.access_token_owner_class), so no FK — same reasoning as
|
||||
# application_tokens.owner_type.
|
||||
|
||||
t.string :subject_type, limit: 128
|
||||
t.bigint :subject_id, unsigned: true
|
||||
t.bigint :application_token_id, unsigned: true
|
||||
# The issued token, in the clear, for the seconds between "approved" and "the
|
||||
# client's next poll". It is cleared on the poll that hands it over, so this
|
||||
# column holds a live secret only while somebody is waiting for it. There is no
|
||||
# way around storing it: the approval happens in a browser and the poll arrives on
|
||||
# a different request, so the two cannot share memory. Everything else about a
|
||||
# token is stored as a digest — this is the one exception, and it is temporary.
|
||||
|
||||
t.string :issued_token, limit: 64
|
||||
t.datetime :approved_at, precision: 3
|
||||
t.datetime :denied_at, precision: 3
|
||||
|
||||
Reference in New Issue
Block a user