Skip to content

How to make extending the driver easier? #120

@cweiske

Description

@cweiske

To implement support for a custom AWS STS login procedure, I extended aus_driver_amazon_s3.

This required three things:

  1. Custom driver class extending AmazonS3Driver with an own DRIVER_TYPE that implements hookInitializeClient to do load credentials via STS
  2. Custom Extractor extending this extension's Extractor class because canProcess() and getDriverRestrictions() are hard-coded to check for AmazonS3Driver::DRIVER_TYPE
  3. Custom FileIndexRepository with a copy of recordUpdatedOrCreated that is identical to this extension's recordUpdatedOrCreated except that my driver type is checked
  4. ext_localconf.php to register my driver, extractor and signal handlers.

It would be nice if I could get rid of step 2 and 3.

What would be the best way to do this?
Move the driver type checks into separate methods so that overriding the classes can be made with minimal effort?
A registry for driver types that aus_driver_amazon's FileIndexRepository and Extractor support?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions