Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

yggdrasil

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yggdrasil - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

3

lib/Client.js

@@ -32,3 +32,4 @@ 'use strict'

password: options.pass,
clientToken: options.token
clientToken: options.token,
requestUser: options.requestUser === true
}, function (err, data) {

@@ -35,0 +36,0 @@ cb(err, data)

@@ -44,7 +44,8 @@ 'use strict'

var hash = utils.mcHexDigest(crypto.createHash('sha1').update(serverid).update(sharedsecret).update(serverkey).digest())
utils.request({
method: 'GET',
uri: host + '/session/minecraft/hasJoined?username=' + username + '&serverId=' + hash,
json: true
}, function (err, resp, body) {
utils.phin(host + '/session/minecraft/hasJoined?username=' + username + '&serverId=' + hash, function (err, resp) {
try {
var body = JSON.parse(resp.body.toString())
} catch (caughtErr) {
err = caughtErr
}
if (err || body && body.hasOwnProperty('id')) {

@@ -51,0 +52,0 @@ cb(err, body)

var version = require('../package.json').version
var request = require('request').defaults({
headers: {
'User-Agent': 'node-yggdrasil/' + version,
'Content-Type': 'application/json'
}
})
var phin = require('phin')
var headers = {
'User-Agent': 'node-yggdrasil/' + version,
'Content-Type': 'application/json'
}
var utils = {}
utils.request = request
utils.phin = phin

@@ -17,7 +17,13 @@ /**

utils.call = function (host, path, data, cb) {
request({
phin({
method: 'POST',
uri: host + '/' + path,
json: data
}, function (err, resp, body) {
url: host + '/' + path,
data: data,
headers: headers
}, function (err, resp) {
try {
var body = JSON.parse(resp.body)
} catch (caughtErr) {
err = caughtErr
}
if (body && body.error) {

@@ -24,0 +30,0 @@ cb(new Error(body.errorMessage))

{
"name": "yggdrasil",
"version": "1.0.0",
"version": "1.1.0",
"author": "Zeke Sonxx <zeke@zekesonxx.com>",

@@ -24,15 +24,15 @@ "description": "Mojang authentication (Yggdrasil) client",

"dependencies": {
"request": "^2.79.0",
"uuid": "^3.0.1"
"phin": "^2.2.1",
"uuid": "^3.1.0"
},
"license": "MIT",
"devDependencies": {
"eslint": "^3.14.0",
"eslint": "^4.4.1",
"eslint-config-standard": "^6.2.1",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "^2.0.1",
"mocha": "~1.18.0",
"nock": "~0.27.2",
"should": "~3.1.3"
"mocha": "^3.5.0",
"nock": "^9.0.14",
"should": "^11.2.1"
}
}

@@ -81,3 +81,4 @@ /* eslint-env mocha */

password: 'hunter2',
clientToken: 'bacon'
clientToken: 'bacon',
requestUser: false
}).reply(200, {

@@ -97,2 +98,27 @@ worked: true

})
it('should work correctly with requestUser true', function (done) {
cscope.post('/authenticate', {
agent: {
version: 1,
name: 'Minecraft'
},
username: 'cake',
password: 'hunter2',
clientToken: 'bacon',
requestUser: true
}).reply(200, {
worked: true
})
ygg.auth({
user: 'cake',
pass: 'hunter2',
token: 'bacon',
requestUser: true
}, function (err, data) { // eslint-disable-line handle-callback-err
data.should.eql({
worked: true
})
done()
})
})
})

@@ -99,0 +125,0 @@ describe('refresh', function () {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc