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

Federation authentication protocol #1837

Merged
merged 55 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
371ddb7
First tests
quadcopterman Apr 2, 2024
67040cd
Added correct logo
quadcopterman Apr 2, 2024
01bf666
Created fragments and solved gradle build issues
quadcopterman Apr 2, 2024
685f433
Adapted fragments
quadcopterman Apr 2, 2024
1106c9c
Add federation init/expect message
arnauds5 Apr 10, 2024
8c7918e
Created UI basics
quadcopterman Apr 11, 2024
a864628
Added a button
quadcopterman Apr 11, 2024
0003dcd
Added all buttons and other UI things
quadcopterman Apr 11, 2024
d9d68d8
add first message data jsons for the federation protocol
ljankoschek Apr 11, 2024
e147590
Fixed top bar
quadcopterman Apr 11, 2024
f6e5140
add first message data jsons for the federation protocol
ljankoschek Apr 11, 2024
6a75f2f
add challenge & challenge request message
1florentin Apr 12, 2024
f5f5efd
removed duplicate jsons
1florentin Apr 12, 2024
39e3440
restore remote schema URI
1florentin Apr 12, 2024
0a1386b
Merge pull request #1804 from dedis/work-federation-1florentin-prot_spec
1florentin Apr 12, 2024
4d59c3c
Merge pull request #1801 from dedis/work-federations-arnauds5-add-aut…
arnauds5 Apr 13, 2024
fbedd9d
Merge remote-tracking branch 'origin/master' into work-federation-pro…
onsriahi14 Apr 13, 2024
f5e309b
ktfmt
quadcopterman Apr 16, 2024
17563f7
Some tests for the LinkedOrganizations fragment
quadcopterman Apr 16, 2024
f86fa32
Invite organization page (first version)
quadcopterman Apr 18, 2024
c5907e7
Invite page almost done
quadcopterman Apr 22, 2024
1367cc0
Formatting
quadcopterman Apr 22, 2024
91633d4
Merge branch 'master' into work-federation-protocol
onsriahi14 Apr 28, 2024
3a1d1d9
Merge branch 'master' into work-federation-protocol
onsriahi14 Apr 28, 2024
679ab2f
adapt json schema of federation_result
1florentin Apr 29, 2024
44743a7
Added invite fragment button and many tests
quadcopterman Apr 30, 2024
5bf988a
Added a test
quadcopterman Apr 30, 2024
fc29ff7
improvements in response to review
1florentin Apr 30, 2024
0929ebd
change url
1florentin Apr 30, 2024
b2f066a
change pattern
1florentin Apr 30, 2024
f5667a9
Corrections
quadcopterman Apr 30, 2024
ffc5f30
Merge pull request #1810 from dedis/work-fe2-johan-federation
quadcopterman May 1, 2024
c505ab3
Merge pull request #1832 from dedis/work-federation-1florentin-result…
onsriahi14 May 2, 2024
b93a3f2
Merge branch 'work-federation-protocol' of github.com:dedis/popstella…
onsriahi14 May 2, 2024
79efa4e
authentication protocol doc
onsriahi14 May 2, 2024
d9c6872
Merge branch 'master' into work-federation-protocol
onsriahi14 May 2, 2024
4233f47
change expect and init prot spec to include the challenge as a stand-…
1florentin May 6, 2024
fb4bcc0
remove old messages
1florentin May 6, 2024
6598f26
adapted expect and init messages to contain the signature
onsriahi14 May 9, 2024
720b45e
Merge branch 'master' into work-federation-protocol
onsriahi14 May 9, 2024
9887e05
Merge branch 'master' into work-be2-ons-authentication-protocol-doc
onsriahi14 May 9, 2024
844a640
requested changes
onsriahi14 May 11, 2024
b16056a
Merge branch 'work-federation-protocol' into work-be2-ons-authenticat…
onsriahi14 May 11, 2024
fc1845e
added "object" and "action" fields to the doc and corrected some typos
onsriahi14 May 12, 2024
c80a04c
fixed failing test & added missing fields in json schemas
1florentin May 13, 2024
b61cec1
add schema validator
1florentin May 13, 2024
5ff09f3
fix formatting
1florentin May 13, 2024
f911ba3
Merge pull request #1846 from dedis/work-federation-1florentin-json_p…
1florentin May 13, 2024
ea3b28c
changed the schematic and sequential representation of the protocol
onsriahi14 May 13, 2024
64a85cd
Merge branch 'work-federation-protocol' into work-be2-ons-authenticat…
onsriahi14 May 13, 2024
0aa490a
Merge branch 'master' into work-federation-protocol
onsriahi14 May 13, 2024
a7d6a35
Merge branch 'work-federation-protocol' into work-be2-ons-authenticat…
onsriahi14 May 13, 2024
0f0fd8e
typo
onsriahi14 May 13, 2024
751fcd8
--
onsriahi14 May 13, 2024
c550805
Merge pull request #1842 from dedis/work-be2-ons-authentication-proto…
onsriahi14 May 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
package message
package test

import (
"encoding/base64"
"os"
"path/filepath"
"popstellar/message/messagedata"
"popstellar/message/query/method/message"
"testing"

"github.com/stretchr/testify/require"
)

func Test_UnmarshalData(t *testing.T) {
messageDataPath := filepath.Join("..", "..", "..", "..", "..", "protocol",
messageDataPath := filepath.Join("..", "..", "..", "protocol",
"examples", "messageData", "lao_create", "lao_create.json")

messageDataBuf, err := os.ReadFile(messageDataPath)
Expand All @@ -20,23 +21,23 @@ func Test_UnmarshalData(t *testing.T) {
laoCreate := messagedata.LaoCreate{}
electionSetup := messagedata.ElectionSetup{}

message := Message{
msg := message.Message{
Data: string(messageDataBuf),
}

err = message.UnmarshalData(&laoCreate)
err = msg.UnmarshalData(&laoCreate)
require.Error(t, err)

err = message.UnmarshalData(&electionSetup)
err = msg.UnmarshalData(&electionSetup)
require.Error(t, err)

messageData := base64.URLEncoding.EncodeToString(messageDataBuf)

message = Message{
msg = message.Message{
Data: messageData,
}

err = message.UnmarshalData(&laoCreate)
err = msg.UnmarshalData(&laoCreate)
require.NoError(t, err)

require.Equal(t, "lao", laoCreate.Object)
Expand Down
8 changes: 8 additions & 0 deletions be1-go/validation/schema_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func init() {
// Override the defaults for loading files and decoding base64 encoded data
jsonschema.Loaders["file"] = loadFileURL
jsonschema.Decoders["base64"] = base64.URLEncoding.DecodeString
jsonschema.Loaders["https"] = loadHttpURL
}

// VerifyJSON verifies that the `msg` follow the schema protocol of name
Expand Down Expand Up @@ -137,3 +138,10 @@ func loadFileURL(s string) (io.ReadCloser, error) {

return protocolFS.Open(path)
}

func loadHttpURL(s string) (io.ReadCloser, error) {
// If for example a message data use a $ref to ../message.json,
// it will try to load using the baseURL => replace path,
// so that only local file is loaded.
return loadFileURL(strings.ReplaceAll(s, baseURL, "file://"))
}
Binary file added docs/assets/authentication_protocol.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading