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

Looking for a new maintainer #76

Open
lieuwex opened this issue Jul 15, 2017 · 20 comments
Open

Looking for a new maintainer #76

lieuwex opened this issue Jul 15, 2017 · 20 comments
Labels
critical Stuff that makes MagisterJS completely unusable help wanted

Comments

@lieuwex
Copy link
Member

lieuwex commented Jul 15, 2017

I'm finished with high school and I don't really feel like continuing a project I can't use personally. It's also pretty hard for me to continue with Magister.js since I don't have a Magister account anymore.

So I'm looking for a new maintainer, Magister.js v2 still needs to be finished. I recommend going with that, since its codebase is way cleaner and sturdier.

So anybody who wants to take this project is free to do so, I recommend building a PR (for the new auth system #73, for example). To get a feel with the codebase, I will of course be happy to help if needed. :)

On the same note, simplyHomework development has also stopped, it's in my opinion a really cool project and it's open source. So you can host it freely and go further with the project, which I would really appreciate. It sucks my big project has to die in such a sad and abrupt manner.

Tell me if you're interested. I wanted to make announce this way earlier, but I was too lazy or smth.

@lieuwex lieuwex added critical Stuff that makes MagisterJS completely unusable help wanted labels Jul 15, 2017
@lieuwex
Copy link
Member Author

lieuwex commented Jul 15, 2017

It's worth nothing that there are several projects relying on Magister.js. So maintainers of those projects are good candidates.

@gruijter
Copy link

Hi @lieuwex Lieuwex. Well, it is good to see you finished school! Sad to see you have to let go of the magister project you worked on so hard all these years. A big thanks for all of this!!!

I am using magisterjs for an app on a home automation system ( https://apps.athom.com/app/com.gruijter.magister ). The app is used by 100+ families. I am worried about being able to maintain the app if magisterjs is not maintained. My programming skills don't even come close to yours, so I won't be able to be the main maintainer. But if a 'real' programmer wants to take up this challenge, I'm willing to assist where I can.

I have some questions that might help a new maintainer get up to speed.

  • Are you in contact with the people of magister? If so, how to get in contact with them?
  • Would they be willing to support magisterjs?
  • Do you have documentation on their API? If not: how did you figure out how the API works?
  • What is the status of v2 magisterjs? Besides New Authentication Manager #73, what is missing or broken before it could be released as stable?

Anyhow: I wish you all the best and hope you are willing to give a helping hand every now and then 🥇

@ATDVIES
Copy link

ATDVIES commented May 8, 2018

Hi @lieuwex
I'm interested to take over your project as I want to develop an add-on application for Magister for my school.
I'm a teacher but also have a background in ICT and programming and want to develop some add-on functionality to Magister.

maybe we can have a chat about it?
best regards
Age

@lieuwex
Copy link
Member Author

lieuwex commented May 9, 2018 via email

@Wqrld
Copy link

Wqrld commented May 14, 2018

@ATDVIES Please do this! I really want to see this project continued. And i am happy to see that there still are teachers that understand and like ICT.

@gruijter
Copy link

@ATDVIES +1

@gruijter
Copy link

And I believe this is priority 1:
https://www.magister.nl/nog-veiliger-inloggen-in-magister/

@Wqrld
Copy link

Wqrld commented May 29, 2018

What has to be done to make v2 work? I'm not great with js but I might be able to maintain magisterjs.

@gruijter none of those changes seem breaking to me. Would be nice to integrate some of it though.

@Wqrld
Copy link

Wqrld commented Jun 6, 2018

are the

		###*
		# @property id
		# @final
		# @type Number
		###

comments required or are they just for yuidoc because the codebase would be a lot better readable without them and yuidoc(to me) isn't helpful.

And would you suggest to continue on v1 of v2?

@lieuwex
Copy link
Member Author

lieuwex commented Jun 15, 2018

@Wqrld sorry for the late reply.

I would highly suggest continuing with v2, practically everything is nicer and well thought out. It also uses promises which and actually has correct error handling for ratelimits. Coffeescript is a dying language and the usage of promises allow to use modern javascript with stuff like await. I forgot all the differences between v1 and v2 but iirc v1 didn't even have 100% support for everything Magister has to offer. (v2 doesn't also but that's just because it's incomplete, instead of a design decision).

Basically all of the v2 code is just better since I practically couldn't code when I started v1. Typing this I remember I also have capability handling support in v2, which means that it doesn't fail hard when doing stuff a school doesn't support, like sending mails for example. Something which is really useful when developing applications to be deployed across schools.

About the yuidoc comments: with v2 the idea was to basically use jsdoc, which is more modern and leaner. You don't have to provide the property field anymore, it supports modern js features and the generated docs file is way nicer.

I don't really care about what documentation system is used, as long one is used. Otherwise you would have to write documentation for the users separate from the code -and believe me– you don't want to do that. The users need docs anyways.

Hope I cleared this up for you, if you have any more questions don't hesitate to ask!

@gruijter
Copy link

gruijter commented Nov 3, 2018

@lieuwex I tested with the npm package you made here: https://www.npmjs.com/package/magister.js/v/2.0.0-alpha.0

Besides that it doesn't install in the folder where I run install, I get problems with the new auth method. It fails in the login function in magister.js

First, getting the xsrf token from the header fails. After some tweaking I managed to get the xsrf. But then it fails in getting the access token:
return res.headers.get('Location').split('&access_token=')[1].split('&')[0];

Actually, I don't get an access token in the response. I get this as response (headers.location):

'https://accounts.magister.net/account/login?returnUrl=%2Fconnect%2Fauthorize%2Fcallback%3Fclient_id%3DM6-broklede.magister.net%26redirect_uri%3Dhttps%253A%252F%252Fbroklede.magister.net%252Foidc%252Fredirect_callback.html%26response_type%3Did_token%2520token%26scope%3Dopenid%2520profile%2520magister.ecs.legacy%2520magister.mdv.broker.read%2520magister.dnn.roles.read%26state%3D2930XXXXXXXXXXX33%26nonce%3D8XXXXXXXXX191%26acr_values%3Dtenant%253Abroklede.magister.net'

@netlob
Copy link
Contributor

netlob commented Nov 3, 2018

@lieuwex I tested with the npm package you made here: https://www.npmjs.com/package/magister.js/v/2.0.0-alpha.0

Besides that it doesn't install in the folder where I run install, I get problems with the new auth method. It fails in the login function in magister.js

First, getting the xsrf token from the header fails. After some tweaking I managed to get the xsrf. But then it fails in getting the access token:
return res.headers.get('Location').split('&access_token=')[1].split('&')[0];

Actually, I don't get an access token in the response. I get this as response (headers.location):

'https://accounts.magister.net/account/login?returnUrl=%2Fconnect%2Fauthorize%2Fcallback%3Fclient_id%3DM6-broklede.magister.net%26redirect_uri%3Dhttps%253A%252F%252Fbroklede.magister.net%252Foidc%252Fredirect_callback.html%26response_type%3Did_token%2520token%26scope%3Dopenid%2520profile%2520magister.ecs.legacy%2520magister.mdv.broker.read%2520magister.dnn.roles.read%26state%3D2930XXXXXXXXXXX33%26nonce%3D8XXXXXXXXX191%26acr_values%3Dtenant%253Abroklede.magister.net'

So you cant login? Or do you just not get the response back?
While testing yesterday I was able to login, but not able to get data, cause I got some stupid errors from my device, which are all client side and not facing to the api.

How did you tried to get the xrsf token?

Also, why cant we continue building the magister-api from idiidk? (https://github.com/idiidk/magister-api/). It works fantastic, and is easy to maintain & update, its not as extended as this one, but with a couple hours of work it will be.

@gruijter
Copy link

gruijter commented Nov 3, 2018

I get an error when trying to login, because in my response header there is no access token.

I havent tried idiidk's version, but I will do so. I hope it has all the functionality I need🙏. Is idiidk actively maintaining and extending his version?

@netlob
Copy link
Contributor

netlob commented Nov 4, 2018

Nope, hé switched to this project to help maintain and expend this one. It has the basic functions.

How did you try to test it?

@gruijter
Copy link

gruijter commented Nov 4, 2018

I ran a small test.js from my windows console (and changed the credentials in test.js to a valid one). It finds the right school, but it then crashes on the res.headers.get... functions in magister.js

'use strict';

// retrieving data via Magister API

const Magister = require('magister.js');

const schoolName = 'test lyceum';
const username = 'test';
const password = 'testing12';


async function test() {
	try {
		const schools = await Magister.getSchools(schoolName);
		console.log(schools);
		const sessionCredentials = {
			school: schools[0], // get first matching school
			username,
			password,
		};
		const magisterSession = await Magister.default(sessionCredentials);
		console.log(magisterSession);
	} catch (error) { console.log(error); }
}

test();

@netlob
Copy link
Contributor

netlob commented Nov 4, 2018

And when you install the alpha version, and put the quick start code in a index.js and then run it with node?

Aka just follow the instructions :)

@gruijter
Copy link

gruijter commented Nov 4, 2018

which instructions ? LOL

Edit: Ah, the instructions in the package description :)

I will try to do it like that.

@netlob
Copy link
Contributor

netlob commented Nov 4, 2018

First create a new npm project with the command:
npm init

Then answer the asked questions

Then install magister.js at the alpha version 2.0 with the command: npm install --save magister.js@2.0.0-alpha.0

Then create an index.js file in your project folder, and put these contents in:

const { default: magister, getSchools } = require('magister.js');
// or with es6 modules:
// import magister, { getSchools } from 'magister.js'

// replace every '<thing>' with your credentials:

getSchools('<schoolname>') // get schools matching '<schoolname>'
	.then((schools) => schools[0]) // get the first school
	.then((school) => magister({ // login
		school,
		username: '<username>',
		password: '<password>',
	}))
	.then((m) => { // done logging in, say hi
		console.log(`Hey ${m.profileInfo.firstName}!`);
	}, (err) => { // something went wrong
		console.error('something went wrong:', err);
	});

Then run: node index.js

@gruijter
Copy link

gruijter commented Nov 4, 2018

OK, this works. 👍

I think I messed up with Magister.default in stead of just Magister.
I will have to go through my own app that I built on top of magister.js v2 to see if these changes work.
https://apps.athom.com/app/com.gruijter.magister

@lieuwex
Copy link
Member Author

lieuwex commented Nov 4, 2018

I've merged v2 to master, meaning that v2 is basically the 'official' version from now on. The v2 branch is deprecated, but I'm keeping it to not mess up URLs for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
critical Stuff that makes MagisterJS completely unusable help wanted
Projects
None yet
Development

No branches or pull requests

5 participants