Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test 802 sends unexpected token in header #103

Open
benjifs opened this issue Oct 7, 2021 · 1 comment
Open

Test 802 sends unexpected token in header #103

benjifs opened this issue Oct 7, 2021 · 1 comment

Comments

@benjifs
Copy link

benjifs commented Oct 7, 2021

I was testing out my micropub server and noticed that after I fixed and stopped handling multiple tokens (in header and body) from 805, 802 started failing.

Checking my server logs it seems like 802 is sending the token in the header even though it doesn't show up that way on the frontend.

I believe this is caused by:

set_up_form_test(test, endpoint, function(data){
var passed_code = false;
var passed_location = false;
if(data.code == 201 || data.code == 202) {
passed_code = true;
}
set_result_icon("#passed_code", passed_code ? 1 : -1);
if(data.location) {
passed_location = true;
$("#location_header_value").html('<a href="'+data.location+'" target="_blank">view post</a>');
}
set_result_icon("#passed_location", passed_location ? 1 : -1);
store_result(test, endpoint, (passed_code && passed_location ? 0 : -1));
$("#continue").removeClass("hidden");
$("#query_url").text($("#query_url").text().replace("%25%25%25", encodeURIComponent(data.location)));
});

Where line 85 should pass in true to skipauth like 801 does since we're sending in the access_token in the body for this test case.

benjifs added a commit to benjifs/micropub that referenced this issue Oct 11, 2021
[micropub.rocks](https://micropub.rocks)

### Creating Posts (Form-Encoded)
✅ | 100 | Create an h-entry post (form-encoded)
✅ | 101 | Create an h-entry post with multiple categories (form-encoded)
✅ | 104 | Create an h-entry with a photo referenced by URL (form-encoded)
✅ | 107 | Create an h-entry post with one category (form-encoded)

### Creating Posts (JSON)
✅ | 200 | Create an h-entry post (JSON)
✅ | 201 | Create an h-entry post with multiple categories (JSON)
➖ | 202 | Create an h-entry with HTML content (JSON)
✅ | 203 | Create an h-entry with a photo referenced by URL (JSON)
➖ | 204 | Create an h-entry post with a nested object (JSON)
✅ | 205 | Create an h-entry post with a photo with alt text (JSON)
✅ | 206 | Create an h-entry with multiple photos referenced by URL (JSON)

### Creating Posts (Multipart)
✅ | 300 | Create an h-entry with a photo (multipart)
✅ | 301 | Create an h-entry with two photos (multipart)

### Updates
✅ | 400 | Replace a property
✅ | 401 | Add a value to an existing property
✅ | 402 | Add a value to a non-existent property
✅ | 403 | Remove a value from a property
✅ | 404 | Remove a property
✅ | 405 | Reject the request if operation is not an array

### Deletes
✅ | 500 | Delete a post (form-encoded)
✅ | 501 | Delete a post (JSON)
➖ | 502 | Undelete a post (form-encoded)
➖ | 503 | Undelete a post (JSON)

### Query
✅ | 600 | Configuration Query
✅ | 601 | Syndication Endpoint Query
✅ | 602 | Source Query (All Properties)
✅ | 603 | Source Query (Specific Properties)

### Media Endpoint
✔️ | 700 | Upload a jpg to the Media Endpoint
✔️ | 701 | Upload a png to the Media Endpoint
✔️ | 702 | Upload a gif to the Media Endpoint

### Authentication
✅ | 800 | Accept access token in HTTP header
✅ | 801 | Accept access token in POST body
⚠️ | 802 | Does not store access token property
✅ | 803 | Rejects unauthenticated requests
⚠️ | 804 | Rejects unauthorized access tokens
⚠️ | 805 | Rejects multiple authentication methods

✔️ - 700, 701, 702 work but show as failed because of [Issue #102](aaronpk/micropub.rocks#102)
⚠️ - 802 [Issue #103](aaronpk/micropub.rocks#103)
⚠️ - 804 [Issue #101](aaronpk/micropub.rocks#101)
⚠️ - 805 [Issue #104](aaronpk/micropub.rocks#104)
➖ - Unsupported
@blturner
Copy link

I encountered this failure as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants