Skip to content

Commit

Permalink
Embed client secret
Browse files Browse the repository at this point in the history
  • Loading branch information
jiri-janousek committed Oct 24, 2021
1 parent 3850b70 commit 2e95e61
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/nuvolakit-runner/MasterController.vala
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public class MasterController : Drtgtk.Application {

private void init_tiliado_account() {
var gumroad = new TiliadoGumroad(
config, Drt.String.unmask(TILIADO_OAUTH2_CLIENT_SECRET.data));
config, TILIADO_OAUTH2_CLIENT_SECRET);
paywall = new TiliadoPaywall(this, gumroad);
paywall.refresh_data.begin((o, res) => {paywall.refresh_data.end(res);});
}
Expand Down
4 changes: 0 additions & 4 deletions src/nuvolakit-runner/secret.vapi

This file was deleted.

2 changes: 1 addition & 1 deletion src/nuvolakit-runner/system/StartupCheck.vala
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class StartupCheck : GLib.Object {
if (model.get_overall_status() != StartupStatus.ERROR) {
connect_master_service();
var gumroad = new TiliadoGumroad(
master.config ?? app.config, Drt.String.unmask(TILIADO_OAUTH2_CLIENT_SECRET.data)
master.config ?? app.config, TILIADO_OAUTH2_CLIENT_SECRET
);
paywall = new TiliadoPaywall(app, gumroad);

Expand Down
2 changes: 2 additions & 0 deletions src/nuvolakit-runner/tiliado/TiliadoApi2.vala
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

namespace Nuvola {

public const string TILIADO_OAUTH2_CLIENT_SECRET = "R8YvORjche0jZvntny9644rqIaqGOmuR0NYDSnh7R36SbFcyvtNTV2tVpkv5XSkY5a1UFyNRtJ4AaijWxkpOx006fVQeQMEU4VcVc2SYq88VOxmV0Y3Dw3NqkUcnpwKN";

public enum TiliadoMembership {
NONE = 0,
BASIC = 1,
Expand Down
12 changes: 0 additions & 12 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -517,18 +517,6 @@ def configure(ctx):
for url in ("report_bug", "request_feature", "ask_question"):
ctx.define("NUVOLA_%s_URL" % url.upper(), branding.get(url + "_url", "").strip())

with open("build/secret.h", "wb") as f:
client_secret = tiliado_api.get("client_secret", "")
if client_secret:
secret = b"{"
for i in mask(client_secret):
secret += str(i).encode("ascii") + b", "
secret += b"0}"
else:
secret = b'""'
f.write(
b'#pragma once\nstatic const char NUVOLA_TILIADO_OAUTH2_CLIENT_SECRET[] = ' + secret + b';')


def build(ctx):
def valalint(source_dir=None, **kwargs):
Expand Down

0 comments on commit 2e95e61

Please sign in to comment.