Code Monkey home page Code Monkey logo

borat's People

Contributors

britram avatar rayhaanj avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

rayhaanj lavaorg

borat's Issues

add CBORReader max object limit

CBORReader needs a way to implement object size limits (e.g., for parser DoS defense). Add a limit field to the CBORReader struct, start counting against the limit when a "top-level" read begins, and return an error when the limit is exceeded.

Use CBOR tags to disambiguate which struct to fill an interface field with

If a struct like the following is passed to the Unmarshaler, then it is unclear as to how the unmarshaler would know which concrete type to fill into the struct field:

type ConvolutedIndirectable interface {
  ConvolutedIndirection() int
}

type Indirector struct {
  I int
}

func (i *Indirector) ConvolutedIndirection() int {
  return i.I
}

type One struct {
  A ConvolutedIndirectable
}

func main() {
  reader := ...
  var o One
  if err := reader.Unmarshal(&o); err != nil {
    ...
  }
}

When the struct is marshaled the information about what struct was actually in the interface is lost, only an un-type-annotated map is transferred via CBOR, so it does not seem possible to work out what type to create to put in this field when unmarshaling.

Clean up SCS

The struct cache should not have to learn the struct each time it unmarshals it (possibly recursively), just store the global struct name in a cache and retrieve it from there each time or create it once and put it there.

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.