Git Product home page Git Product logo

homeserver's Issues

API: POST /createRoom

Parameters:

  • invite
    • create m.room.member events for each invitation
  • name
  • visibility
  • invite_3pid
  • topic
  • preset
    • set default value of m.room.history_visibility event
    • set default value of m.room.join_rules event
    • increase power levels for all users invited to trusted private chats
  • creation_content
  • initial_state
    • always create m.room.power_levels
    • always create m.room.join_rules
    • always create m.room.history_visibility
    • validate and create additional state events
  • room_alias_name
    • create alias
    • create m.room.aliases event
    • create m.room.canonical_alias event if one isn't provided in initial_state

Global behavior:

  • create m.room.member for the user creating the room

API: GET /sync

Spec

https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-sync

Parameters

  • since
  • full_state
  • filter
  • timeout
  • set_presence

State

  • next_batch
  • presence
    • events
  • rooms
    • join
      • unread_notifications
      • timeline
        • limited
        • prev_batch
        • events (basic)
      • state
        • events
      • account_data
        • events
      • ephemeral
        • events
    • leave
      • timeline
        • limited
        • prev_batch
        • events
      • state
        • events
    • invite
      • invite_state
        • events

Details

  • Support partial timeline.events, timeline.limited
  • No support for timeline.prev_batch
  • Support following in timeline.events (m.room.member, m.room.message, m.room.history_visibility)
  • Support timeline limiting by filter
  • Support partial since, full_state
  • Remove empty rooms rooms.join, rooms.leave, rooms.invite
  • Parse all parameters since, filter, full_state, set_presence, timeout
  • No support for parameter: set_presence, timeout
  • Basic invalidation for parameters
  • Basic macro for TryInto e.g. impl MessageEvent for Event
  • Support presence in sync with since
  • Support sync set_presence

API: PUT /rooms/:room_id/send/:event_type/:transaction_id

  • Create new events from input.
  • Verify the room exists.
  • Verify the sender has permission to create the event.
  • Ensure requests are idempotent using transaction IDs.
  • Protect against ToCToU errors with permissions.
  • Add tests.
    • Text message
    • Custom message type
    • Message for non-existent room
    • Message for room where the sender doesn't have permission

Macaroon not 32 bytes

I wrote the following go code to generate a 32 byte crypographically secure random number and base64 encode it, but I continually recieve Failed to load configuration file: macaroon_secret_key must be 32 bytes.

Output examples:

  • vqjwJXXjPci9+6o6Le9BZQ576l5xo7C+MTdRCju9
  • 4B6W17W6l4eJT7TxHp7oVnG4r6Mjus7hDjATDSp2
  • bq30jK/m0EaLPJYlK6YWMr2wdZVGxu1uDPzCR1Gh
package main

import (
    "bytes"
    "crypto/rand"
    "encoding/base64"
    "fmt"
    "log"
)

func main() {
    b := make([]byte, 32)
    _, err := rand.Read(b)
    if err != nil {
        log.Fatal(err)
    }
    buf := bytes.Buffer{}
    base64.NewEncoder(base64.StdEncoding, &buf).Write(b)
    fmt.Println(string(buf.Bytes()))
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.