How can I make some attributes of the File resource private?

For now, I was able to quickly achieve this using the register method in ./src/index.ts.

  const fileSchema = strapi.contentTypes['plugin::upload.file']
  const publicAttributes = ['url']
  // make all attributes private except for specified ones
  fileSchema.attributes = Object.keys(fileSchema.attributes).reduce((attributes, attributeKey) => {
    return {
      ...attributes,
      [attributeKey]: {
        ...fileSchema.attributes[attributeKey],
        ...(publicAttributes.indexOf(attributeKey) === -1 && { private: true }),
      }
    }
  }, {} as Schema.Attributes)

Summary: I’m overriding the file schema to make all attributes private except for the ones I need.