-
Notifications
You must be signed in to change notification settings - Fork 44
Add Gateway.APICommands for /api allowlists #10
Conversation
2c818da
to
e825524
Compare
init.go
Outdated
@@ -66,6 +66,7 @@ func Init(out io.Writer, nBitsForKeypair int) (*Config, error) { | |||
"Access-Control-Allow-Methods": []string{"GET"}, | |||
"Access-Control-Allow-Headers": []string{"X-Requested-With", "Range"}, | |||
}, | |||
APICommands: DefaultGatewayAPICommands(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it end up writing these to the config? If it does, I'm worried we won't be able to add commands later without a migration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess alternatively we could keep the default an empty array?
serialize/serialize.go
Outdated
@@ -55,17 +54,26 @@ func encode(w io.Writer, value interface{}) error { | |||
} | |||
|
|||
// Load reads given file and returns the read config, or error. | |||
func Load(filename string) (*config.Config, error) { | |||
func Load(filename string, cfg interface{}) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where's the cyclic import this is fixing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes use of code that lives/lived one directory up, so gx-go rw
wasn't able to rewrite the import path here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this PR branch is based off #9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. I can't reproduce. Let's discuss there.
e825524
to
4eccf67
Compare
4eccf67
to
ef208a2
Compare
Updated -- removed the gx dep commit, and moving the actual default commands list to go-ipfs itself. |
LGTM, merge when ready. |
For ipfs/kubo#4595 (comment)
No fs-repo migration needed.