Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ssu
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
mer-core
ssu
Commits
77ccda89
Commit
77ccda89
authored
Oct 24, 2012
by
Aard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add variable URLs for credentials files
parent
268affd1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
1 deletion
+13
-1
libssu/ssu.cpp
libssu/ssu.cpp
+7
-0
libssu/ssu.h
libssu/ssu.h
+4
-0
ssu-defaults.ini
ssu-defaults.ini
+1
-0
ssuurlresolver/ssuurlresolver.cpp
ssuurlresolver/ssuurlresolver.cpp
+1
-1
No files found.
libssu/ssu.cpp
View file @
77ccda89
...
@@ -126,6 +126,13 @@ QString Ssu::credentialsScope(QString repoName, bool rndRepo){
...
@@ -126,6 +126,13 @@ QString Ssu::credentialsScope(QString repoName, bool rndRepo){
return
"your-configuration-is-broken-and-does-not-contain-credentials-scope"
;
return
"your-configuration-is-broken-and-does-not-contain-credentials-scope"
;
}
}
QString
Ssu
::
credentialsUrl
(
QString
scope
){
if
(
settings
->
contains
(
"credentials-url-"
+
scope
))
return
settings
->
value
(
"credentials-url-"
+
scope
).
toString
();
else
return
"your-configuration-is-broken-and-does-not-contain-credentials-url-for-"
+
scope
;
}
QString
Ssu
::
deviceFamily
(){
QString
Ssu
::
deviceFamily
(){
QString
model
=
deviceModel
();
QString
model
=
deviceModel
();
...
...
libssu/ssu.h
View file @
77ccda89
...
@@ -36,6 +36,10 @@ class Ssu: public QObject {
...
@@ -36,6 +36,10 @@ class Ssu: public QObject {
* @return a string containing the scope; it can be used to look up login credentials using credentials()
* @return a string containing the scope; it can be used to look up login credentials using credentials()
*/
*/
QString
credentialsScope
(
QString
repoName
,
bool
rndRepo
=
false
);
QString
credentialsScope
(
QString
repoName
,
bool
rndRepo
=
false
);
/**
* Return the URL for which credentials scope is valid
*/
QString
credentialsUrl
(
QString
scope
);
/**
/**
* Try to find the device family for the system this is running on
* Try to find the device family for the system this is running on
*/
*/
...
...
ssu-defaults.ini
View file @
77ccda89
...
@@ -14,3 +14,4 @@ credentials-scope=example
...
@@ -14,3 +14,4 @@ credentials-scope=example
[2]
[2]
release
=
latest
release
=
latest
credentials-url-example
=
https://example.com
ssuurlresolver/ssuurlresolver.cpp
View file @
77ccda89
...
@@ -84,7 +84,7 @@ void SsuUrlResolver::run(){
...
@@ -84,7 +84,7 @@ void SsuUrlResolver::run(){
credentialsFile
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Text
|
QIODevice
::
Truncate
);
credentialsFile
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Text
|
QIODevice
::
Truncate
);
QTextStream
out
(
&
credentialsFile
);
QTextStream
out
(
&
credentialsFile
);
QPair
<
QString
,
QString
>
credentials
=
ssu
.
credentials
(
credentialsScope
);
QPair
<
QString
,
QString
>
credentials
=
ssu
.
credentials
(
credentialsScope
);
out
<<
"[
ssu-credentials
]
\n
"
;
out
<<
"[
"
<<
ssu
.
credentialsUrl
(
credentialsScope
)
<<
"
]
\n
"
;
out
<<
"username="
<<
credentials
.
first
<<
"
\n
"
;
out
<<
"username="
<<
credentials
.
first
<<
"
\n
"
;
out
<<
"password="
<<
credentials
.
second
<<
"
\n
"
;
out
<<
"password="
<<
credentials
.
second
<<
"
\n
"
;
out
.
flush
();
out
.
flush
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment