Skip to content
Permalink
Browse files

implement basic get/post to three_legged monalisa APIs

  • Loading branch information...
mathieujobin committed Sep 1, 2019
1 parent 69b6833 commit 9b01b630cc4212f1a9e6af5fa5dab0c44acbc109
Showing with 21 additions and 12 deletions.
  1. +4 −0 CHANGELOG.md
  2. +16 −11 lib/monalisa_client.dart
  3. +1 −1 pubspec.yaml
@@ -1,3 +1,7 @@
## [0.0.5] - Sep 1st 2019
* allow to suffix an env to config filename
* basic get/post three legged hits to monalisa

## [0.0.4] - Jun 15th 2019

* improve package score, cook up a quick example, no code change since 0.0.2
@@ -39,20 +39,25 @@ class MonalisaClient {
});
}

/*
/// NotImplemented, will allow two legged post request to monalisa and other services
Future two_legged_post() {
Future<Map> three_legged_post(String url, Map data) {
return httpClient.post(url, headers: three_legged_auth_headers, body: json.encode(data)).then((res) {
if (res.statusCode == 201) {
return json.decode(res.body);
} else {
return <String, dynamic>{"statusCode": res.statusCode, "body": res.body};
}
});
}

/// NotImplemented, will allow three legged get request to monalisa and other services
Future three_legged_get() {
http_client.getUrl(Uri.parse())
.then((HttpClientRequest request) {
return request.close();
}).then((HttpClientResponse response) {
Future<Map> three_legged_get(String url) {
return httpClient.get(url, headers: three_legged_auth_headers).then((res) {
if (res.statusCode == 200) {
return json.decode(res.body);
} else {
return <String, dynamic>{"statusCode": res.statusCode, "body": res.body};
}
});
}*/
}

/// Very important method, will initiate a first token creation or verify existing token.
Future<bool> ensure_user_token() async {
@@ -1,6 +1,6 @@
name: monalisa_client
description: Small library to authenticate your Flutter up with Monalisa API/SSO
version: 0.0.4
version: 0.0.5
author: Mathieu Jobin <mathieu@solidcode.bz>
homepage: https://github.com/mathieujobin/monalisa_client

0 comments on commit 9b01b63

Please sign in to comment.
You can’t perform that action at this time.