Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Add Gateway.APICommands for /api allowlists #10

Merged
2 commits merged into from
Sep 24, 2018
Merged

Conversation

ghost
Copy link

@ghost ghost commented Sep 15, 2018

For ipfs/kubo#4595 (comment)

No fs-repo migration needed.

@ghost ghost self-assigned this Sep 15, 2018
@ghost ghost added the status/in-progress In progress label Sep 15, 2018
@ghost ghost force-pushed the feat/gateway-commands branch from 2c818da to e825524 Compare September 20, 2018 18:33
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(),
Copy link
Member

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.

Copy link
Author

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?

@@ -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 {
Copy link
Member

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?

Copy link
Author

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

Copy link
Author

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

Copy link
Member

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.

@ghost ghost mentioned this pull request Sep 24, 2018
@ghost ghost force-pushed the feat/gateway-commands branch from e825524 to 4eccf67 Compare September 24, 2018 14:42
@ghost ghost force-pushed the feat/gateway-commands branch from 4eccf67 to ef208a2 Compare September 24, 2018 14:45
@ghost
Copy link
Author

ghost commented Sep 24, 2018

Updated -- removed the gx dep commit, and moving the actual default commands list to go-ipfs itself.

@Stebalien
Copy link
Member

LGTM, merge when ready.

@ghost ghost merged commit de53f68 into master Sep 24, 2018
@ghost ghost removed the status/in-progress In progress label Sep 24, 2018
@ghost ghost deleted the feat/gateway-commands branch September 24, 2018 22:04
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant